diff --git a/pc4mobx/hrmSalary/apis/attendance.js b/pc4mobx/hrmSalary/apis/attendance.js index 4b7ea0f7..f528ce12 100644 --- a/pc4mobx/hrmSalary/apis/attendance.js +++ b/pc4mobx/hrmSalary/apis/attendance.js @@ -78,11 +78,19 @@ export const getAttendanceDetail = (params) => { //数据采集-考勤引用-删除考勤数据 export const deleteAttendance = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/attendQuote/delete", - "POST", - params - ); + return fetch("/api/bs/hrmsalary/attendQuote/delete", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(params), + }).then((res) => res.json()); + // return WeaTools.callApi( + // "/api/bs/hrmsalary/attendQuote/delete", + // "POST", + // params + // ); }; //数据采集-考勤引用-导出考勤数据 diff --git a/pc4mobx/hrmSalary/components/importModal/index.js b/pc4mobx/hrmSalary/components/importModal/index.js index 7f4a11d0..76eb1fdc 100644 --- a/pc4mobx/hrmSalary/components/importModal/index.js +++ b/pc4mobx/hrmSalary/components/importModal/index.js @@ -45,8 +45,8 @@ export default class ImportModal extends React.Component { try { params && Object.keys(params).forEach((key) => { if(!params[key] || params[key] == "") { - message.warning("参数不完整"); - throw new Error("参数不完整") + message.warning("请选择税款所属期"); + throw new Error("请选择税款所属期") } }) } catch(e) { diff --git a/pc4mobx/hrmSalary/components/importModal/modalStep1.js b/pc4mobx/hrmSalary/components/importModal/modalStep1.js index ee1d23f8..ac05df15 100644 --- a/pc4mobx/hrmSalary/components/importModal/modalStep1.js +++ b/pc4mobx/hrmSalary/components/importModal/modalStep1.js @@ -85,7 +85,7 @@ export default class ModalStep1 extends React.Component {
- 导入excel + 导入Excel
diff --git a/pc4mobx/hrmSalary/pages/calculate/index.js b/pc4mobx/hrmSalary/pages/calculate/index.js index 03b53fb1..2613fc8a 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/index.js @@ -148,13 +148,19 @@ export default class Calculate extends React.Component { // 获取列表 getColumns() { - const { calculateStore: { salaryListColumns }, taxAgentStore: { showOperateBtn } } = this.props; + const { + calculateStore: { salaryListColumns }, + taxAgentStore: { showOperateBtn } + } = this.props; let columns = [...salaryListColumns]; columns.map(item => { - if (item.title == "操作" && showOperateBtn ) { + if (item.title == "操作" && showOperateBtn) { item.render = (text, record) => { - const accountBtn = _.filter(record.operate, it => it.text == "核算"); - const notAccountBtn = _.filter(record.operate, it => it.text != "核算"); + const accountBtn = _.filter( + record.operate, + it => it.text == "核算" || it.text == "重新核算" + ); + const notAccountBtn = _.filter(record.operate, it => it.text != "核算" && it.text != "重新核算"); let operateBtn = []; if (!_.isEmpty(accountBtn)) { operateBtn.push( @@ -167,8 +173,10 @@ export default class Calculate extends React.Component { { - if (it.text == "核算") { - this.handleAccount(record); + if (it.text == "核算" || it.text == "重新核算") { + it.text == "核算" + ? this.handleAccount(record) + : this.handleReaccount(record); } }}> {it.text} @@ -205,7 +213,10 @@ export default class Calculate extends React.Component { )} }> - + ); } @@ -303,8 +314,7 @@ export default class Calculate extends React.Component { const { startDate, endDate } = this.state; return (
- { - showOperateBtn && + {showOperateBtn && - } + }
{ - if(item.key == "cz") { - item.render = (text, record) => { - return () - } + if (item.key == "cz") { + item.render = (text, record) => { + return ( + + ); + }; } - }) + }); this.state = { value: "", selectedKey: "0", searchValue: "", modalParam: { salarySobId: "", - salaryYearMonth: moment(new Date()).format("YYYY-MM"), // 薪资所属月 + salaryYearMonth: moment(new Date()).format("YYYY-MM") // 薪资所属月 }, modalVisiable: false, selectItemVisible: false, @@ -63,341 +95,494 @@ export default class Attendance extends React.Component { fieldSettingSearchValue: "", fieldCurrent: 1, inited: false - } - this.fieldSearch = {} - this.listSearch = {} + }; + this.fieldSearch = {}; + this.listSearch = {}; this.recordId = ""; // 考勤数据列表查看选择项 this.salaryYearMonth = ""; // 考勤数据查看,当前数据的薪资所属月 - this.pageInfo = {current: 1, pageSize: 10} + this.pageInfo = { current: 1, pageSize: 10 }; } componentWillMount() { - const { attendanceStore: { doInit, getLedgerList }} = this.props; - doInit() + const { attendanceStore: { doInit, getLedgerList } } = this.props; + doInit(); getLedgerList().then(() => { this.setState({ inited: true - }) - }) + }); + }); } onShowSlide() { - const {attendanceStore : {setSlideVisiable}} = this.props; - setSlideVisiable(true) + const { attendanceStore: { setSlideVisiable } } = this.props; + setSlideVisiable(true); } onItemOperatesClick(record, index, operate, flag) { - switch(operate.index.toString()){ - case '0': // 查看明细 + switch (operate.index.toString()) { + case "0": // 查看明细 this.onItemEdit(record); break; } - }; + } onItemEdit(record) { this.setState({ itemMangeVisible: true - }) + }); - const { attendanceStore: { setCurrentItemOperate, setCurrentItem }} = this.props; - setCurrentItemOperate("update") - setCurrentItem(record) + const { + attendanceStore: { setCurrentItemOperate, setCurrentItem } + } = this.props; + setCurrentItemOperate("update"); + setCurrentItem(record); } // 字段列表分页 handleFieldPageChange(value) { - const { attendanceStore: {getAttendanceFieldList} } = this.props; - this.fieldSearch.current = value - getAttendanceFieldList(this.fieldSearch) + const { attendanceStore: { getAttendanceFieldList } } = this.props; + this.fieldSearch.current = value; + getAttendanceFieldList(this.fieldSearch); } handleFieldShowSizeChange(pageInfo) { - const { attendanceStore: {getAttendanceFieldList} } = this.props; - this.fieldSearch.current = value - getAttendanceFieldList({...this.fieldSearch, ...pageInfo}) + const { attendanceStore: { getAttendanceFieldList } } = this.props; + this.fieldSearch.current = value; + getAttendanceFieldList({ ...this.fieldSearch, ...pageInfo }); } // 列表 handleDataPageChange(value) { - const { attendanceStore: { getAttendanceList }} = this.props; - this.listSearch.current = value - getAttendanceList(this.listSearch) + const { attendanceStore: { getAttendanceList } } = this.props; + this.listSearch.current = value; + getAttendanceList(this.listSearch); } handleDataShowSizeChange(pageInfo) { - const { attendanceStore: { getAttendanceList }} = this.props; - getAttendanceList({...this.listSearch, ...pageInfo}) + const { attendanceStore: { getAttendanceList } } = this.props; + getAttendanceList({ ...this.listSearch, ...pageInfo }); } // 下载导入模板链接点击 handleTemplateLinkClick() { - const { attendanceStore: { downloadTemplate }} = this.props; - const { modalParam: {salarySobId, salaryYearMonth}} = this.state; - if(!salaryYearMonth || salaryYearMonth == "") { - message.warning("薪资所属月不能为空") - return + const { attendanceStore: { downloadTemplate } } = this.props; + const { modalParam: { salarySobId, salaryYearMonth } } = this.state; + if (!salaryYearMonth || salaryYearMonth == "") { + message.warning("薪资所属月不能为空"); + return; } - if(!salarySobId || salarySobId == "") { - message.warning("薪资账套不能为空") - return + if (!salarySobId || salarySobId == "") { + message.warning("薪资账套不能为空"); + return; } - downloadTemplate(salaryYearMonth, salarySobId) + downloadTemplate(salaryYearMonth, salarySobId); } // 导入预览 handlePreviewImport(params) { - const { attendanceStore: {previewAttendQuote}} = this.props; - previewAttendQuote(params) + const { attendanceStore: { previewAttendQuote } } = this.props; + previewAttendQuote(params); } // 考勤导入 handleImport(params) { - const { attendanceStore: { importAttendQuoteData }} = this.props; - importAttendQuoteData(params) + const { attendanceStore: { importAttendQuoteData } } = this.props; + importAttendQuoteData(params); } // 导入完成 handleFinish() { - this.setState({modalVisiable: false}) - const { attendanceStore: { getAttendanceList, step }} = this.props; - if(step == 2) { - this.getAttendanceList({}) + this.setState({ modalVisiable: false }); + const { attendanceStore: { getAttendanceList, step } } = this.props; + if (step == 2) { + this.getAttendanceList({ ...this.pageInfo }); } } // 考情引用的列 getColumns(columns) { - let result = [...columns] + const { attendanceStore: { deleteAttendance, doInit } } = this.props; + let result = [...columns]; result.push({ title: "操作", key: "operate", render: (text, record) => { - return this.handleViewAttendance(record)}>查看 + return ( +
+ this.handleViewAttendance(record)}>查看 + { + Modal.confirm({ + title: "信息确认", + content: "确认删除", + onOk: () => { + deleteAttendance([ + record.id + ]).then(({ status, errormsg }) => { + if (status) { + message.success("删除成功"); + doInit({}); + } else { + message.error(errormsg || "删除失败"); + } + }); + }, + onCancel: () => {} + }); + }}> + 删除 + + }> + + + + +
+ ); } - }) + }); return result; } - // 查看考勤详情 + // 查看考勤详情 handleViewAttendance(record) { - const { attendanceStore: {setSlideVisiable}} = this.props; - this.recordId = record.id - this.salaryYearMonth = record.attendCycle - setSlideVisiable(true) + const { attendanceStore: { setSlideVisiable } } = this.props; + this.recordId = record.id; + this.salaryYearMonth = record.attendCycle; + setSlideVisiable(true); } // 引用同步Cancel事件 handleRefereCancel() { - this.setState({refereAttendFormVisible: false}) - const { attendanceStore: { getAttendanceList }} = this.props; - this.listSearch.current = 1 - getAttendanceList(this.listSearch) + this.setState({ refereAttendFormVisible: false }); + const { attendanceStore: { getAttendanceList } } = this.props; + this.listSearch.current = 1; + getAttendanceList(this.listSearch); } // 获取周期 handleLoadCycle(month, sob) { - if(!month || month == "") { - return + if (!month || month == "") { + return; } - if(!sob || sob == "") { - return + if (!sob || sob == "") { + return; } - const { attendanceStore: {getSalaryCycleAndAttendCycle}} = this.props; - getSalaryCycleAndAttendCycle(month, sob) + const { attendanceStore: { getSalaryCycleAndAttendCycle } } = this.props; + getSalaryCycleAndAttendCycle(month, sob); } - // 初始导入参数 handleInitImportModal() { - const { attendanceStore: {setPreviewAttendQuoteColumns, setPreviewAttendQuoteDataSource, setImportResult}} = this.props; - setPreviewAttendQuoteColumns([]) - setPreviewAttendQuoteDataSource([]) - setImportResult({}) + const { + attendanceStore: { + setPreviewAttendQuoteColumns, + setPreviewAttendQuoteDataSource, + setImportResult + } + } = this.props; + setPreviewAttendQuoteColumns([]); + setPreviewAttendQuoteDataSource([]); + setImportResult({}); } // 引用详情列表搜索 handleSearch(params) { - const { attendanceStore: {viewAttendQuote}} = this.props; - let request = {attendQuoteId: this.recordId, ...params} - viewAttendQuote(request) + const { attendanceStore: { viewAttendQuote } } = this.props; + let request = { attendQuoteId: this.recordId, ...params }; + viewAttendQuote(request); } - handleExportAttendQuote= ()=>{ - const url= `${window.location.origin}/api/bs/hrmsalary/attendQuote/export?attendQuoteId=${this.recordId}` - window.open(url, '_self'); - } + handleExportAttendQuote = () => { + const url = `${window.location + .origin}/api/bs/hrmsalary/attendQuote/export?attendQuoteId=${this + .recordId}`; + window.open(url, "_self"); + }; render() { - const { attendanceStore, taxAgentStore: {showOperateBtn} } = this.props; + const { attendanceStore, taxAgentStore: { showOperateBtn } } = this.props; const { modalParam } = this.state; - const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = attendanceStore; - const { step, setStep, setSlideVisiable, slideVisiable, doBatchDelete, attendTableStore, fieldSettingAttendList, fieldSettingCustomList, setFieldSettingAttendList, setFieldSettingCustomList, searchFieldSettingList } = attendanceStore; - const { getAttendanceFieldSettingList, saveAttendanceFieldSetting, fieldDataSource, fieldTableStore, fieldPageInfo, attendanceDataSource, attendanceColumns, attendancePageInfo, importLedgerList, - previewAttendQuoteColumns, previewAttendQuoteDataSource, importResult, cycle} = attendanceStore + const { + loading, + hasRight, + form, + condition, + tableStore, + showSearchAd, + getTableDatas, + doSearch, + setShowSearchAd + } = attendanceStore; + const { + step, + setStep, + setSlideVisiable, + slideVisiable, + doBatchDelete, + attendTableStore, + fieldSettingAttendList, + fieldSettingCustomList, + setFieldSettingAttendList, + setFieldSettingCustomList, + searchFieldSettingList + } = attendanceStore; + const { + getAttendanceFieldSettingList, + saveAttendanceFieldSetting, + fieldDataSource, + fieldTableStore, + fieldPageInfo, + attendanceDataSource, + attendanceColumns, + attendancePageInfo, + importLedgerList, + previewAttendQuoteColumns, + previewAttendQuoteDataSource, + importResult, + cycle + } = attendanceStore; const selectedRowKeys = toJS(tableStore.selectedRowKeys) || []; // tableStore 右侧选中数组 - - if (!hasRight && !loading) { // 无权限处理 + + if (!hasRight && !loading) { + // 无权限处理 return renderNoright(); } const batchDelete = () => { - doBatchDelete() - this.fieldSearch = {fieldName: this.state.fieldName} - getAttendanceFieldList({fieldName: this.state.fieldName}) - } - - const rightMenu = [// 右键菜单 - { - key: 'BTN_DEL', - icon: , - content : '批量删除', - disable: selectedRowKeys.length === 0, // 没有选中禁用 - onClick : batchDelete, - } + doBatchDelete(); + this.fieldSearch = { fieldName: this.state.fieldName }; + getAttendanceFieldList({ fieldName: this.state.fieldName }); + }; + + const rightMenu = [ + // 右键菜单 + // { + // key: 'BTN_DEL', + // icon: , + // content : '批量删除', + // disable: selectedRowKeys.length === 0, // 没有选中禁用 + // onClick : batchDelete, + // } ]; - const collectParams = { // 收藏功能配置 - favname: '考勤引用', + const collectParams = { + // 收藏功能配置 + favname: "考勤引用", favouritetype: 1, objid: 0, - link: 'wui/index.html#/ns_demo03/index', - importantlevel: 1, + link: "wui/index.html#/ns_demo03/index", + importantlevel: 1 }; - const adBtn = [ // 高级搜索内部按钮 - , - , - , + const adBtn = [ + // 高级搜索内部按钮 + , + , + ]; - const topTab = [{ - title: "考勤数据", - viewcondition: "0" - }, - { - title: "字段管理", - viewcondition: "1" - }]; + const topTab = [ + { + title: "考勤数据", + viewcondition: "0" + }, + { + title: "字段管理", + viewcondition: "1" + } + ]; const renderSearchOperationItem = () => { const { taxAgentStore: { showOperateBtn } } = this.props; - return showOperateBtn ?
- - -
: null - - } + return showOperateBtn + ?
+ + +
+ : null; + }; const renderLeftOperation = () => { - const { attendanceStore: {getAttendanceList}} = this.props; - return
薪资所属月: { - this.listSearch = { - salaryYearMonth: range.map(item => moment(item).format("YYYY-MM")) - } - getAttendanceList(this.listSearch) - }}/>
- } - + const { attendanceStore: { getAttendanceList } } = this.props; + return ( +
+ 薪资所属月:{" "} + { + this.listSearch = { + salaryYearMonth: range.map(item => + moment(item).format("YYYY-MM") + ) + }; + getAttendanceList(this.listSearch); + }} + /> +
+ ); + }; const renderHeaderSetCompoent = () => { return ( - { - getAttendanceFieldSettingList({sourceType:'IMPORT'}) - this.setState({ - selectItemVisible: true - }) - }}/> - ) - } + { + getAttendanceFieldSettingList({ sourceType: "IMPORT" }); + this.setState({ + selectItemVisible: true + }); + }} + /> + ); + }; const renderFormComponent = () => { - return ( + return ( - - 薪资所属月: - { - this.setState({modalParam: {...modalParam, salaryYearMonth: value}}) - this.handleLoadCycle(value, this.state.modalParam.salarySobId) - }} - /> - - - 薪资账套: - { - this.state.inited && - - } - - - 薪资周期: - { - cycle.salaryCycle - } - - - 考勤周期: - { - cycle.attendCycle - } - + + + 薪资所属月: + + { + this.setState({ + modalParam: { ...modalParam, salaryYearMonth: value } + }); + this.handleLoadCycle(value, this.state.modalParam.salarySobId); + }} + /> + + + + 薪资账套: + + {this.state.inited && + } + + + + 薪资周期: + + {cycle.salaryCycle} + + + + 考勤周期: + + {cycle.attendCycle} + - )} - + ); + }; const renderCustomOperate = () => { return ( -
- { - showOperateBtn && - - // 导出全部 +
+ {showOperateBtn && + + // 导出全部 } {this.setState({searchValue: v})}} - onSearch={(v) => {this.handleSearch({keyword: v})}} + onChange={v => { + this.setState({ searchValue: v }); + }} + onSearch={v => { + this.handleSearch({ keyword: v }); + }} />
- ) - } + ); + }; - const handleItemSearch = (value) => { - const { attendanceStore: {getAttendanceFieldList}} = this.props; - this.fieldSearch = {fieldName: value} - getAttendanceFieldList(this.fieldSearch) - } + const handleItemSearch = value => { + const { attendanceStore: { getAttendanceFieldList } } = this.props; + this.fieldSearch = { fieldName: value }; + getAttendanceFieldList(this.fieldSearch); + }; const handleNewClick = () => { - const { attendanceStore: {setCurrentItemOperate}} = this.props; - this.setState({itemMangeVisible: true}) - setCurrentItemOperate("add") - } + const { attendanceStore: { setCurrentItemOperate } } = this.props; + this.setState({ itemMangeVisible: true }); + setCurrentItemOperate("add"); + }; const renderRightOperation = () => { return ( -
- { - showOperateBtn && - - } - {this.setState({fieldName: value})}} onSearch={(value) => { - this.setState({fieldSettingSearchValue: value}) - handleItemSearch(value) - }}/> +
+ {showOperateBtn && + } + { + this.setState({ fieldName: value }); + }} + onSearch={value => { + this.setState({ fieldSettingSearchValue: value }); + handleItemSearch(value); + }} + />
- ) - } + ); + }; const menu = ( @@ -405,51 +590,72 @@ export default class Attendance extends React.Component { ); - const handleTabChange = (v) => { - const { attendanceStore: { getAttendanceFieldList, getAttendanceList }} = this.props; + const handleTabChange = v => { + const { + attendanceStore: { getAttendanceFieldList, getAttendanceList } + } = this.props; this.setState({ tabSelectedKey: v - }) + }); - if(v == "1") { - this.fieldSearch = {fieldName: this.state.fieldName} - getAttendanceFieldList(this.fieldSearch) - } else if(v == "0") { - this.listSearch = {} - getAttendanceList(this.listSearch) + if (v == "1") { + this.fieldSearch = { fieldName: this.state.fieldName }; + getAttendanceFieldList(this.fieldSearch); + } else if (v == "0") { + this.listSearch = {}; + getAttendanceList(this.listSearch); } - } + }; const handleSwitchItemChange = (record, value) => { - const { attendanceStore : {updateAttendanceFieldStatus, getAttendanceFieldList}} = this.props; + const { + attendanceStore: { updateAttendanceFieldStatus, getAttendanceFieldList } + } = this.props; let request = { id: record.id, enableStatus: value - } + }; updateAttendanceFieldStatus(request).then(result => { - this.fieldSearch = {fieldName: this.state.fieldName} - getAttendanceFieldList(this.fieldSearch) - }) - - } + this.fieldSearch = { fieldName: this.state.fieldName }; + getAttendanceFieldList(this.fieldSearch); + }); + }; // 字段Columns - const getFieldColumns = (columns) => { - let newColumns = columns.filter(item => item.hide == "false") + const getFieldColumns = columns => { + let newColumns = columns.filter(item => item.hide == "false"); newColumns = newColumns.map(column => { let newColumn = column; - newColumn.render = (text, record, index) => { //前端元素转义 - let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex]; - switch(newColumn.dataIndex) { + newColumn.render = (text, record, index) => { + //前端元素转义 + let valueSpan = + record[newColumn.dataIndex + "span"] !== undefined + ? record[newColumn.dataIndex + "span"] + : record[newColumn.dataIndex]; + switch (newColumn.dataIndex) { case "username": - return {this.onItemEdit(record)}} - dangerouslySetInnerHTML={{ __html: valueSpan }} /> + return ( + { + this.onItemEdit(record); + }} + dangerouslySetInnerHTML={{ __html: valueSpan }} + /> + ); case "enableStatus": - return {handleSwitchItemChange(record, value)}}/> + return ( + { + handleSwitchItemChange(record, value); + }} + /> + ); default: - return
+ return
; } - } + }; return newColumn; }); // 与e10保持一致,先去掉字段管理页面的操作列 @@ -461,92 +667,103 @@ export default class Attendance extends React.Component { // {this.onItemEdit(record)}}>查看明细 // ) // } - // }) + // }) return newColumns; - } + }; // 保存回调 - const handleItemMangeSave = (value) => { - const { attendanceStore: { saveAttendanceField, getAttendanceFieldList }} = this.props; - value.fieldType = value.fieldType == "1" ? "NUMBER" : "TEXT" - saveAttendanceField(value) - this.fieldSearch = {fieldName: this.state.fieldName} - getAttendanceFieldList(this.fieldSearch) - this.setState({itemMangeVisible: false}) - } + const handleItemMangeSave = value => { + const { + attendanceStore: { saveAttendanceField, getAttendanceFieldList } + } = this.props; + value.fieldType = value.fieldType == "1" ? "NUMBER" : "TEXT"; + saveAttendanceField(value); + this.fieldSearch = { fieldName: this.state.fieldName }; + getAttendanceFieldList(this.fieldSearch); + this.setState({ itemMangeVisible: false }); + }; - const handleItemMangeUpdate = (value) => { - const { attendanceStore: {updateAttendanceField, getAttendanceFieldList }} = this.props; + const handleItemMangeUpdate = value => { + const { + attendanceStore: { updateAttendanceField, getAttendanceFieldList } + } = this.props; // alert(JSON.stringify(value)); - value.fieldType = value.fieldType == "1" ? "NUMBER" : "TEXT" - updateAttendanceField(value) - this.fieldSearch = {fieldName: this.state.fieldName} - getAttendanceFieldList(this.fieldSearch) - this.setState({itemMangeVisible: false}) - } + value.fieldType = value.fieldType == "1" ? "NUMBER" : "TEXT"; + updateAttendanceField(value); + this.fieldSearch = { fieldName: this.state.fieldName }; + getAttendanceFieldList(this.fieldSearch); + this.setState({ itemMangeVisible: false }); + }; - const handleShowChecked = (value) => { - const { attendanceStore: {fieldSettingAttendList, fieldSettingCustomList, setFieldSettingAttendList, setFieldSettingCustomList, searchFieldSettingList }} = this.props; - if(value) { - let attendList = [...fieldSettingAttendList] - let customList = [...fieldSettingCustomList] - setFieldSettingAttendList(attendList.filter(item => item.checked == value)) - setFieldSettingCustomList(customList.filter(item => item.checked == value)) + const handleShowChecked = value => { + const { + attendanceStore: { + fieldSettingAttendList, + fieldSettingCustomList, + setFieldSettingAttendList, + setFieldSettingCustomList, + searchFieldSettingList + } + } = this.props; + if (value) { + let attendList = [...fieldSettingAttendList]; + let customList = [...fieldSettingCustomList]; + setFieldSettingAttendList( + attendList.filter(item => item.checked == value) + ); + setFieldSettingCustomList( + customList.filter(item => item.checked == value) + ); } else { - searchFieldSettingList(this.state.fieldSettingSearchValue) + searchFieldSettingList(this.state.fieldSettingSearchValue); } - - } + }; const handleonRestoreDefault = (sourceType = "IMPORT") => { - const { attendanceStore: {returnToAttendanceFieldSettingDefault}} = this.props; + const { + attendanceStore: { returnToAttendanceFieldSettingDefault } + } = this.props; returnToAttendanceFieldSettingDefault(sourceType); - } + }; const handleSetDefault = (sourceType = "IMPORT") => { - const { attendanceStore: {saveAttendanceFieldSettingAsDefault}} = this.props; + const { + attendanceStore: { saveAttendanceFieldSettingAsDefault } + } = this.props; saveAttendanceFieldSettingAsDefault(sourceType); - } + }; const handleRefereHeaderSet = () => { const { attendanceStore: { getAttendanceFieldSettingList } } = this.props; - getAttendanceFieldSettingList({sourceType:'QUOTE'}) - } + getAttendanceFieldSettingList({ sourceType: "QUOTE" }); + }; return (
+ collectParams={collectParams}> } // 左侧图标 - iconBgcolor='#F14A2D' // 左侧图标背景色 + icon={} // 左侧图标 + iconBgcolor="#F14A2D" // 左侧图标背景色 showDropIcon={true} // 是否显示下拉按钮 dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同) - dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 - > - { - this.state.tabSelectedKey == 0 ? -
- { - handleTabChange(v) - }} - /> - { - + dropMenuProps={{ collectParams }}> + {this.state.tabSelectedKey == 0 + ?
+ { + handleTabChange(v); }} /> - {/* {}} + /> + {/* */} - { - this.pageInfo.current = value - this.handleDataPageChange(value) - }} - onShowSizeChange={(current, pageSize) => { - this.pageInfo = {current, pageSize} - this.handleDataShowSizeChange(this.pageInfo) - }} - /> -
- : -
- { - this.setState({ - tabSelectedKey: v - }) + { + this.pageInfo.current = value; + this.handleDataPageChange(value); + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = { current, pageSize }; + this.handleDataShowSizeChange(this.pageInfo); }} /> - +
+ :
+ { + this.setState({ + tabSelectedKey: v + }); + }} + /> + { - this.pageInfo.current = value - this.handleFieldPageChange(value) - }} - onShowSizeChange={(current, pageSize) => { - this.pageInfo = {current, pageSize} - this.handleFieldShowSizeChange(this.pageInfo) - }} - /> + // getColumns={getFieldColumns} + // onOperatesClick={this.onItemOperatesClick.bind(this)} + // /> - - } - rightContent={ - { + this.pageInfo.current = value; + this.handleFieldPageChange(value); + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = { current, pageSize }; + this.handleFieldShowSizeChange(this.pageInfo); + }} + /> + } + rightContent={ + - } - /> -
- } - + ]} + /> + } + /> +
}
- { - this.state.modalVisiable && { - this.handleInitImportModal() + this.handleInitImportModal(); }} params={this.state.modalParam} columns={previewAttendQuoteColumns} @@ -638,57 +851,130 @@ export default class Attendance extends React.Component { setStep={setStep} slideDataSource={previewAttendQuoteDataSource} importResult={importResult} - onFinish={() => {this.handleFinish()}} - previewImport={(params) => {this.handlePreviewImport(params)}} - importFile={(params) => {this.handleImport(params)}} + onFinish={() => { + this.handleFinish(); + }} + previewImport={params => { + this.handlePreviewImport(params); + }} + importFile={params => { + this.handleImport(params); + }} headerSetCompoent={renderHeaderSetCompoent()} - templateLink={() => {this.handleTemplateLinkClick()}} - renderFormComponent={() => renderFormComponent()} - visiable={this.state.modalVisiable} - onCancel={() => { - this.handleFinish()}} - /> - } - + templateLink={() => { + this.handleTemplateLinkClick(); + }} + renderFormComponent={() => renderFormComponent()} + visiable={this.state.modalVisiable} + onCancel={() => { + this.handleFinish(); + }} + />} - {handleonRestoreDefault()}} onSetDefault={() => {handleSetDefault()}} onSave={() => {saveAttendanceFieldSetting()}} onShowChecked={(value) => {handleShowChecked(value)}} onSearch={(value) => {searchFieldSettingList(value)}} visible={this.state.selectItemVisible} onCancel={() => this.setState({selectItemVisible: false})}> -
- {setFieldSettingAttendList(value)}} items={fieldSettingAttendList} title={"考勤模块"}/> - {setFieldSettingCustomList(value)}} items={fieldSettingCustomList} title={"自定义"}/> -
-
- - { - this.state.refereAttendFormVisible && {saveAttendanceFieldSetting("QUOTE")}} onRestoreDefault={() => {handleonRestoreDefault("QUOTE")}} onSetDefault={() => {handleSetDefault("QUOTE")}} onShowChecked={(value) => {handleShowChecked(value)}} onSearch={(value) => {searchFieldSettingList(value)}} onChange={(value) => {setFieldSettingAttendList(value)}} items={fieldSettingAttendList} onHeaderSet={() => {handleRefereHeaderSet()}} visible={this.state.refereAttendFormVisible} onCancel={() => { - this.handleRefereCancel() - }}/> - } - { - this.state.itemMangeVisible && {handleItemMangeUpdate(value)}} onSave={(value) => handleItemMangeSave(value)} onCancel={() => {this.setState({itemMangeVisible: false})}}/> - } - { - slideVisiable && { + handleonRestoreDefault(); + }} + onSetDefault={() => { + handleSetDefault(); + }} + onSave={() => { + saveAttendanceFieldSetting(); + }} + onShowChecked={value => { + handleShowChecked(value); + }} + onSearch={value => { + searchFieldSettingList(value); + }} + visible={this.state.selectItemVisible} + onCancel={() => this.setState({ selectItemVisible: false })}> +
+ { + setFieldSettingAttendList(value); + }} + items={fieldSettingAttendList} + title={"考勤模块"} /> - } - content={()} - onClose={() => setSlideVisiable(false)} - showMask={true} - closeMaskOnClick={() => setSlideVisiable(false)} /> - } + { + setFieldSettingCustomList(value); + }} + items={fieldSettingCustomList} + title={"自定义"} + /> +
+ + + {this.state.refereAttendFormVisible && + { + saveAttendanceFieldSetting("QUOTE"); + }} + onRestoreDefault={() => { + handleonRestoreDefault("QUOTE"); + }} + onSetDefault={() => { + handleSetDefault("QUOTE"); + }} + onShowChecked={value => { + handleShowChecked(value); + }} + onSearch={value => { + searchFieldSettingList(value); + }} + onChange={value => { + setFieldSettingAttendList(value); + }} + items={fieldSettingAttendList} + onHeaderSet={() => { + handleRefereHeaderSet(); + }} + visible={this.state.refereAttendFormVisible} + onCancel={() => { + this.handleRefereCancel(); + }} + />} + {this.state.itemMangeVisible && + { + handleItemMangeUpdate(value); + }} + onSave={value => handleItemMangeSave(value)} + onCancel={() => { + this.setState({ itemMangeVisible: false }); + }} + />} + {slideVisiable && + + } + content={ + + } + onClose={() => setSlideVisiable(false)} + showMask={true} + closeMaskOnClick={() => setSlideVisiable(false)} + />}
- ) + ); } } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index faffd74e..668a9bb1 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -351,9 +351,7 @@ export default class CumDeduct extends React.Component { // exportCumDeductList(); const { selectedKey } = this.state; const url = `${window.location - .origin}/api/bs/hrmsalary/addUpDeduction/export?ids=${selectedKey.join( - "," - )}&declareMonth=${this.state.monthValue}&taxAgentId=${this.state + .origin}/api/bs/hrmsalary/addUpDeduction/export?ids=&declareMonth=${this.state.monthValue}&taxAgentId=${this.state .taxAgentId == "All" ? "" : this.state.taxAgentId}`; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index 9556f441..38deca5b 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -11,7 +11,7 @@ import { Modal, message, Row, - Col, + Col } from "antd"; import { @@ -23,7 +23,7 @@ import { WeaSelect, WeaHelpfulTip, WeaSlideModal, - WeaTable, + WeaTable } from "ecCom"; import moment from "moment"; @@ -52,11 +52,11 @@ export default class CumSituation extends React.Component { slideSelectedKey: [], //详情表格的选中项 visiable: false, inited: false, - monthValue: moment(new Date()).format("YYYY-MM"), + monthValue: moment(new Date()).format("YYYY"), taxAgentId: "All", modalParam: { - taxYearMonth: "", - }, + taxYearMonth: "" + } }; } @@ -64,12 +64,12 @@ export default class CumSituation extends React.Component { // 初始化渲染页面 const { cumSituationStore: { doInit }, - taxAgentStore: { fetchTaxAgentOption }, + taxAgentStore: { fetchTaxAgentOption } } = this.props; - doInit({taxYearMonth: [this.state.monthValue], taxAgentId: ""}); + doInit({ year: this.state.monthValue, taxAgentId: "" }); fetchTaxAgentOption().then(() => { this.setState({ - inited: true, + inited: true }); }); } @@ -78,35 +78,35 @@ export default class CumSituation extends React.Component { const { monthValue, taxAgentId } = this.state; const { taxAgentStore: { taxAgentOption }, - cumSituationStore: { form, getTableDatas }, + cumSituationStore: { form, getTableDatas } } = this.props; return (
- 申报月份: + 纳税年度: { - this.setState({monthValue: v}) - let params = {} - if(taxAgentId == "All") { - params.taxAgentId = "" + this.setState({ monthValue: v }); + let params = {}; + if (taxAgentId == "All") { + params.taxAgentId = ""; } else { - params.taxAgentId = taxAgentId + params.taxAgentId = taxAgentId; } - if(v != null && v != "") { - params.taxYearMonth = [v] + if (v != null && v != "") { + params.year = v; } - getTableDatas(params) + getTableDatas(params); }} />
@@ -114,38 +114,34 @@ export default class CumSituation extends React.Component {
个税扣缴义务人: - { - this.state.inited && { - let params = {} - if(v == "All") { - params.taxAgentId = "" + let params = {}; + if (v == "All") { + params.taxAgentId = ""; } else { - params.taxAgentId = v + params.taxAgentId = v; } - if(monthValue != null && monthValue != "") { - params.taxYearMonth = [monthValue] + if (monthValue != null && monthValue != "") { + params.year = monthValue; } - getTableDatas(params) - this.setState({taxAgentId: v}) + getTableDatas(params); + this.setState({ taxAgentId: v }); }} - /> - } + />}
- ) + ); } - renderFormComponent() { const { modalParam } = this.state; - const { - taxAgentStore: { taxAgentOption }, - } = this.props; + const { taxAgentStore: { taxAgentOption } } = this.props; return ( @@ -157,23 +153,22 @@ export default class CumSituation extends React.Component { - this.setState({ modalParam: { taxYearMonth: value } }) - } + onChange={value => + this.setState({ modalParam: { taxYearMonth: value } })} /> ); } - onEdit = (record) => { + onEdit = record => { const { cumSituationStore: { slideVisiable, setSlideVisiable, getCumDeductDetailList, - setCurrentRecord, - }, + setCurrentRecord + } } = this.props; setSlideVisiable(true); setCurrentRecord(record); @@ -181,12 +176,12 @@ export default class CumSituation extends React.Component { }; // 增加编辑功能,重写columns绑定事件 - getColumns = (columns) => { + getColumns = columns => { let newColumns = []; if (!columns) { return []; } - newColumns = columns.map((column) => { + newColumns = columns.map(column => { let newColumn = column; newColumn.render = (text, record, index) => { //前端元素转义 @@ -229,7 +224,6 @@ export default class CumSituation extends React.Component { setStep(0); } - onOperatesClick = (record, index, operate, flag) => { switch (operate.index.toString()) { case "0": // 查看明细 @@ -239,9 +233,7 @@ export default class CumSituation extends React.Component { }; showColumn = () => { - const { - cumSituationStore: { tableStore }, - } = this.props; + const { cumSituationStore: { tableStore } } = this.props; tableStore.setColSetVisible(true); tableStore.tableColSet(true); }; @@ -249,34 +241,35 @@ export default class CumSituation extends React.Component { // 导入参数初始化 handleInitImport = () => { const { - cumSituationStore: { setSlideDataSource, setImportResult }, + cumSituationStore: { setSlideDataSource, setImportResult } } = this.props; setSlideDataSource([]); setImportResult({}); }; - onSelectChange = (val) => { + onSelectChange = val => { this.setState({ - selectedKey: val, + selectedKey: val }); }; // 搜索 handleSearch() { - const { cumSituationStore:{getTableDatas} } = this.props; + const { cumSituationStore: { getTableDatas } } = this.props; const { monthValue, taxAgentId } = this.state; - let params = {} - if(monthValue != null && monthValue !== "") { - params.taxYearMonth = [monthValue] + let params = {}; + if (monthValue != null && monthValue !== "") { + params.year = monthValue; } - if(taxAgentId != null && taxAgentId !== "" && taxAgentId !== "All") { - params.taxAgentId = taxAgentId + if (taxAgentId != null && taxAgentId !== "" && taxAgentId !== "All") { + params.taxAgentId = taxAgentId; } - getTableDatas(params) + getTableDatas(params); } render() { - const { cumSituationStore, taxAgentStore, slideSelectedKey } = this.props; + const { cumSituationStore, taxAgentStore } = this.props; + const { slideSelectedKey } = this.state; const { loading, dataSource, @@ -291,7 +284,7 @@ export default class CumSituation extends React.Component { doSearch, setShowSearchAd, previewImport, - importFile, + importFile } = cumSituationStore; const { taxAgentOption, showOperateBtn } = taxAgentStore; const { @@ -304,7 +297,7 @@ export default class CumSituation extends React.Component { setStep, slideDataSource, importResult, - setPageObj, + setPageObj } = cumSituationStore; const selectedRowKeys = toJS(tableStore.selectedRowKeys) || []; const { modalParam, monthValue, taxAgentId } = this.state; @@ -329,7 +322,7 @@ export default class CumSituation extends React.Component { favouritetype: 1, objid: 0, link: "wui/index.html#/ns_demo03/index", - importantlevel: 1, + importantlevel: 1 }; const adBtn = [ // 高级搜索内部按钮 @@ -341,13 +334,13 @@ export default class CumSituation extends React.Component { , , + ]; const topTab = []; const renderSearchOperationItem = () => { - return
; + return
; }; const handleButtonClick = () => { @@ -357,10 +350,8 @@ export default class CumSituation extends React.Component { // exportCumSituationList(); const { selectedKey } = this.state; const url = `${window.location - .origin}/api/bs/hrmsalary/addUpSituation/export?ids=${selectedKey.join( - "," - )}&declareMonth=${this.state.monthValue}&taxAgentId=${this.state - .taxAgentId == "All" + .origin}/api/bs/hrmsalary/addUpSituation/export?ids=&year=${this + .state.monthValue}&taxAgentId=${this.state.taxAgentId == "All" ? "" : this.state.taxAgentId}`; window.open(url, "_self"); @@ -375,7 +366,7 @@ export default class CumSituation extends React.Component { const url = `${window.location .origin}/api/bs/hrmsalary/addUpSituation/export?ids=${selectedKey.join( "," - )}&declareMonth=${this.state.monthValue}&taxAgentId=${this.state + )}&year=${this.state.monthValue}&taxAgentId=${this.state .taxAgentId == "All" ? "" : this.state.taxAgentId}`; @@ -387,9 +378,7 @@ export default class CumSituation extends React.Component { }; const handleBtnImport = () => { - const { - cumSituationStore: { setModalVisiable, setStep }, - } = this.props; + const { cumSituationStore: { setModalVisiable, setStep } } = this.props; setStep(0); setModalVisiable(true); }; @@ -411,12 +400,12 @@ export default class CumSituation extends React.Component { } type="ghost"> 导出全部 - , + ]; const handleExportAllDetailClick = () => { const { - cumSituationStore: { exportCumSituationDetailList, currentRecord }, + cumSituationStore: { exportCumSituationDetailList, currentRecord } } = this.props; exportCumSituationDetailList(currentRecord.id); }; @@ -427,7 +416,7 @@ export default class CumSituation extends React.Component { return; } const { - cumSituationStore: { exportCumSituationDetailList, currentRecord }, + cumSituationStore: { exportCumSituationDetailList, currentRecord } } = this.props; exportCumSituationDetailList( currentRecord.id, @@ -452,7 +441,7 @@ export default class CumSituation extends React.Component { const pagination = { total: pageObj.total, - showTotal: (total) => `共 ${total} 条`, + showTotal: total => `共 ${total} 条`, showSizeChanger: true, pageSizeOptions: ["10", "20", "50", "100"], onShowSizeChange(current, pageSize) { @@ -460,8 +449,8 @@ export default class CumSituation extends React.Component { getTableDatas({ current, pageSize, - taxAgentId:taxAgentId==='All' ? '' : taxAgentId, - declareMonth: monthValue && [monthValue], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId, + year: monthValue }); }, onChange(current) { @@ -469,47 +458,45 @@ export default class CumSituation extends React.Component { getTableDatas({ current, pageSize: pageObj.pageSize, - taxAgentId:taxAgentId==='All' ? '' : taxAgentId, - declareMonth: monthValue && [monthValue], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId, + year: monthValue }); - }, + } }; const rowSelection = { selectedRowKeys: this.state.selectedKey, - onChange: this.onSelectChange, + onChange: this.onSelectChange }; - const newColumns = _.map([...columns], (item) => { + const newColumns = _.map([...columns], item => { if (item.dataIndex === "username") { return { ...item, width: 100, fixed: "left", - render: (text, record) => ( + render: (text, record) => - ), }; } else if (item.dataIndex === "taxAgentName") { return { ...item, width: 180, - fixed: "left", + fixed: "left" }; } else if (item.dataIndex === "operate") { return { ...item, width: 100, fixed: "right", - render: (text, record) => ( + render: (text, record) => - ), }; } else { return { ...item, width: 150 }; @@ -518,9 +505,7 @@ export default class CumSituation extends React.Component { return (
- + } // 左侧图标 @@ -533,7 +518,7 @@ export default class CumSituation extends React.Component { setShowSearchAd(bool)} //高级搜索面板受控 + setShowSearchAd={bool => setShowSearchAd(bool)} //高级搜索面板受控 searchsAd={getSearchs(form, toJS(condition), 2)} // 高级搜索内部数据 buttonsAd={adBtn} // 高级搜索内部按钮 onSearch={() => this.handleSearch()} // 点搜索按钮时的回调 @@ -553,7 +538,7 @@ export default class CumSituation extends React.Component { /> - {modalVisiable && ( + {modalVisiable && { this.handleInitImport(); @@ -570,10 +555,10 @@ export default class CumSituation extends React.Component { }} slideDataSource={slideDataSource} importResult={importResult} - previewImport={(params) => { + previewImport={params => { previewImport(params); }} - importFile={(params) => { + importFile={params => { importFile(params); }} renderFormComponent={() => this.renderFormComponent()} @@ -581,9 +566,8 @@ export default class CumSituation extends React.Component { onCancel={() => { this.handleCancel(); }} - /> - )} - {slideVisiable && ( + />} + {slideVisiable && - this.setState({ slideSelectedKey: val }) - } + onChangeSlideSelectKey={val => + this.setState({ slideSelectedKey: val })} /> } onClose={() => setSlideVisiable(false)} showMask={true} closeMaskOnClick={() => setSlideVisiable(false)} - /> - )} + />}
); } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js index 58983992..786c3c26 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js @@ -261,7 +261,7 @@ export default class OtherDeduct extends React.Component { } render() { - const { otherDeductStore, taxAgentStore, slideSelectedKey } = this.props; + const { otherDeductStore, taxAgentStore } = this.props; const { loading, dataSource, @@ -292,7 +292,7 @@ export default class OtherDeduct extends React.Component { setPageObj } = otherDeductStore; const selectedRowKeys = toJS(tableStore.selectedRowKeys) || []; - const { modalParam, monthValue, taxAgentId } = this.state; + const { modalParam, monthValue, taxAgentId, slideSelectedKey } = this.state; const detailSelectedRowKeys = toJS(slideTableStore.selectedRowKeys) || []; if (!hasRight && !loading) { @@ -341,10 +341,8 @@ export default class OtherDeduct extends React.Component { // exportOtherDeductList(); const { selectedKey } = this.state; const url = `${window.location - .origin}/api/bs/hrmsalary/otherDeduction/export?ids=${selectedKey.join( - "," - )}&declareMonth=${this.state.monthValue}&taxAgentId=${this.state - .taxAgentId == "All" + .origin}/api/bs/hrmsalary/otherDeduction/export?ids=&declareMonth=${this + .state.monthValue}&taxAgentId=${this.state.taxAgentId == "All" ? "" : this.state.taxAgentId}`; window.open(url, "_self"); diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js index d0e6522d..ceab419b 100644 --- a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js @@ -151,8 +151,8 @@ export default class PayrollGrant extends React.Component { 批量发放 批量撤回 - 全部导出 - 导出选中 + {/* 全部导出 + 导出选中 */} {/* 自定义列 */} ); diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollGrantModal.js b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollGrantModal.js index e9ce0752..0184797c 100644 --- a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollGrantModal.js +++ b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollGrantModal.js @@ -153,6 +153,7 @@ export default class payrollGrantModal extends React.Component { { this.props.onCancel(); }}> diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollWithdrawModal.js b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollWithdrawModal.js index 7a2cba87..4a45bae4 100644 --- a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollWithdrawModal.js +++ b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/payrollWithdrawModal.js @@ -154,6 +154,7 @@ export default class PayrollWithdrawModal extends React.Component { { this.props.onCancel(); }}> diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js index 15db873f..b170375b 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js @@ -87,7 +87,8 @@ export default class AccumulationFundForm extends React.Component { 公积金方案名称: - { this.handleFormChange({fundSchemeId: value}) this.handleFetchPaymentForm(value); }}> @@ -114,7 +115,8 @@ export default class AccumulationFundForm extends React.Component { 公积金缴纳组织: - this.handleFormChange({paymentOrganization: value})}> { items && items[0].items &&items[0].items[1] && items[0].items[1].options.map(item => ( @@ -124,7 +126,8 @@ export default class AccumulationFundForm extends React.Component { 公积金个人实际承担方: - { this.handleFormChange({underTake: value}) }}> { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/baseForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/baseForm.js index b5cf3cf3..0b7f41cc 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/baseForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/baseForm.js @@ -19,20 +19,20 @@ export default class BaseForm extends React.Component {
- 姓名 + 姓名: {baseFormData.username} - 部门 + 部门: {baseFormData.department} - 岗位 + 岗位: {baseFormData.position} - 入职日期 + 入职日期: {baseFormData.hiredate} - 手机号 + 手机号: {baseFormData.telephone} - 离职时间 + 离职时间: {baseFormData.dimissionDate} diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index 90a57c9b..e6326c3f 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -154,7 +154,7 @@ export default class Archives extends React.Component { handleSearch() { const { archivesStore: {getTableDatas}} = this.props; - getTableDatas(this.pageInfo) + getTableDatas({...this.pageInfo, current: 1}) } render() { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.less index 274d9f49..30d8a6d4 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.less @@ -7,5 +7,7 @@ text-overflow: ellipsis; padding-left: 10px; padding-right: 10px; + border: 1px solid #e2e2e2; + margin-bottom: 0!important; } } \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js index 0ef4be98..d10e6ad4 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js @@ -92,7 +92,8 @@ export default class OtherForm extends React.Component { 其他福利方案名称: - { this.handleFormChange({otherName: value}) this.handleFetchPaymentForm(value); }}> @@ -107,7 +108,8 @@ export default class OtherForm extends React.Component { 社保缴纳组织: - this.handleFormChange({paymentOrganization: value})}> { items && items[0].items &&items[0].items[1] && items[0].items[1].options.map(item => ( diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js index 575b171b..8c53bbc8 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js @@ -88,7 +88,8 @@ export default class SocialSecurityForm extends React.Component { 社保方案名称: - { this.handleFormChange({socialName: value}) this.handleFetchPaymentForm(value) }}> @@ -118,7 +119,8 @@ export default class SocialSecurityForm extends React.Component { 社保个人实际承担方: - { if(status) { this.setState({adminData : data}) - if(data.isAdminEnable) { + if(data.isOpenDevolution) { getAdminTaxAgentList().then((data) => { let taxAgentList = data.map(item => { let result = {} @@ -78,6 +78,20 @@ export default class StandingBook extends React.Component { isAdmin: true }}) }) + }else{ + fetchTaxAgentOption().then(({data}) => { + let taxAgentList = data.map(item => { + let result = {} + result.showname = item.content + result.key = item.id + "" + result.selected = false + return result + }) + this.setState({dialogProps: { + ...dialogProps, + options: taxAgentList, + }}) + }) } this.getCommonList({ ...this.state.tableParams, current }); } diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js index ec2fdbb5..1f767197 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js @@ -2,14 +2,21 @@ * Author: 黎永顺 * Description: 正常缴纳月份 * Date: 2022-04-20 08:56:08 - * LastEditTime: 2022-05-09 15:05:57 + * LastEditTime: 2022-06-28 18:04:37 */ import React, { Component } from "react"; import { Icon, Tooltip, Button, message, Modal, Spin } from "antd"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; -import { WeaBrowser, WeaTable, WeaPopoverHrm, WeaDialog, WeaInputSearch } from "ecCom"; +import { + WeaBrowser, + WeaTable, + WeaPopoverHrm, + WeaDialog, + WeaInputSearch +} from "ecCom"; import { getSearchs } from "../../../../util"; +import { getQueryString } from "../../../../util/url"; import _ from "lodash"; import "./index.less"; @@ -24,12 +31,12 @@ export default class NormalIndex extends Component { selectedRowKeys: [], addProps: { title: "", - visible: false, + visible: false }, tableData: { list: [], columns: [], - total: 0, + total: 0 }, searchValue: "" }; @@ -49,49 +56,70 @@ export default class NormalIndex extends Component { const { current } = this.state; nextProps.selectedKey === "1" ? this.getNormalList({ billMonth, current, paymentOrganization }) - : this.getSupplementaryList({ billMonth, current, paymentOrganization }); + : this.getSupplementaryList({ + billMonth, + current, + paymentOrganization + }); } } - handleSearch(value) { const { billMonth, selectedKey, paymentOrganization } = this.props; const { current } = this.state; selectedKey === "1" - ? this.getNormalList({ billMonth, current, paymentOrganization, userName:value }) - : this.getSupplementaryList({ billMonth, current, paymentOrganization, userName:value }); + ? this.getNormalList({ + billMonth, + current: 1, + paymentOrganization, + userName: value + }) + : this.getSupplementaryList({ + billMonth, + current: 1, + paymentOrganization, + userName: value + }); } handleSave = () => { - const { siaccountCommonSave, siaccountSupplementarySave, form } = - this.props.standingBookStore; + const { + siaccountCommonSave, + siaccountSupplementarySave, + form + } = this.props.standingBookStore; const { billMonth, selectedKey, paymentOrganization } = this.props; if (selectedKey === "1") { const { includes, excludes } = form.getFormParams(); const payload = { billMonth, includes: includes.split(","), - excludes: _.isEmpty(excludes) ? excludes.split(",") : [], + excludes: _.isEmpty(excludes) ? excludes.split(",") : [] }; siaccountCommonSave(payload).then(() => { message.success("添加成功"); - this.getNormalList({ billMonth, paymentOrganization, current: this.state.current }); + this.getNormalList({ + billMonth, + paymentOrganization, + current: this.state.current + }); this.setState({ addProps: { ...this.state.addProps, title: "", - visible: false, - }, + visible: false + } }); }); } else { - form.validateForm().then((f) => { + const paymentOrganization = getQueryString("paymentOrganization"); + form.validateForm().then(f => { if (f.isValid) { const { includes, billMonth: billMonthList, excludes, - projects, + projects } = form.getFormParams(); const payload = { billMonth, @@ -99,20 +127,26 @@ export default class NormalIndex extends Component { includes: includes.split(","), // excludes: excludes.split(","), projects: projects.split(","), + paymentOrganization }; siaccountSupplementarySave(payload).then(() => { message.success("添加成功"); this.getSupplementaryList({ billMonth, - current: this.state.current, + current: this.state.current }); - this.setState({ - addProps: { - ...this.state.addProps, - title: "", - visible: false, + this.setState( + { + addProps: { + ...this.state.addProps, + title: "", + visible: false + } }, - }); + () => { + form.resetForm(); + } + ); }); } else { f.showErrors(); @@ -125,81 +159,77 @@ export default class NormalIndex extends Component { getNormalList = (payload = {}) => { const { getNormalList } = this.props.standingBookStore; getNormalList({ ...payload }).then(({ list, columns = [], total }) => { - columns = _.map( - _.filter(columns, (it) => it.dataIndex !== "id"), - (it) => { - if (it.dataIndex === "employeeId") { - it = { - ...it, - width: 150, - fixed: "left", - - render: (text, r) => { - const { userName, employeeId } = r; - return ( - {userName} - ); - }, - }; - it.title = "姓名" - } - return { + columns = _.map(_.filter(columns, it => it.dataIndex !== "id"), it => { + if (it.dataIndex === "employeeId") { + it = { ...it, - title: , width: 150, + fixed: "left", + + render: (text, r) => { + const { userName, employeeId } = r; + return ( + + {userName} + + ); + } }; + it.title = "姓名"; } - ); + return { + ...it, + title: , + width: 150 + }; + }); this.setState({ tableData: { list, columns, - total, - }, + total + } }); }); }; getSupplementaryList = (payload = {}) => { const { getSupplementaryList } = this.props.standingBookStore; - getSupplementaryList({ ...payload }).then( - ({ list, columns = [], total }) => { - columns = _.map( - _.filter(columns, (it) => it.dataIndex !== "id"), - (it) => { - if (it.dataIndex === "employeeId") { - it = { - ...it, - width: 150, - fixed: "left", - render: (text, r) => { - const { userName, employeeId } = r; - return ( - {userName} - ); - }, - }; - it.title = "姓名" + getSupplementaryList({ + ...payload + }).then(({ list, columns = [], total }) => { + columns = _.map(_.filter(columns, it => it.dataIndex !== "id"), it => { + if (it.dataIndex === "employeeId") { + it = { + ...it, + width: 150, + fixed: "left", + render: (text, r) => { + const { userName, employeeId } = r; + return ( + + {userName} + + ); } - return { - ...it, - title: ( - - ), - width: 150, - }; - } - ); - this.setState({ - tableData: { - list, - columns, - total, - }, - }); - } - ); + }; + it.title = "姓名"; + } + return { + ...it, + title: , + width: 150 + }; + }); + this.setState({ + tableData: { + list, + columns, + total + } + }); + }); }; - onSelectChange = (selectedRowKeys) => { + onSelectChange = selectedRowKeys => { this.setState({ selectedRowKeys }); }; handleBatchDelete = () => { @@ -211,8 +241,8 @@ export default class NormalIndex extends Component { message.warning("未勾选数据!"); } else { const includes = _.map( - _.filter(list, (it) => selectedRowKeys.includes(it.id)), - (item) => item.employeeId + _.filter(list, it => selectedRowKeys.includes(it.id)), + item => item.employeeId ); Modal.confirm({ title: "确认信息", @@ -222,7 +252,11 @@ export default class NormalIndex extends Component { message.success("删除成功"); this.setState({ selectedRowKeys: [] }); selectedKey === "1" - ? this.getNormalList({ billMonth, paymentOrganization, current: this.state.current }) + ? this.getNormalList({ + billMonth, + paymentOrganization, + current: this.state.current + }) : this.getSupplementaryList({ billMonth, current: this.state.current, @@ -230,13 +264,15 @@ export default class NormalIndex extends Component { }); }); }, - onCancel: () => {}, + onCancel: () => {} }); } }; handleAdd = () => { - const { siaccountCommonForm, querySupplementaryForm } = - this.props.standingBookStore; + const { + siaccountCommonForm, + querySupplementaryForm + } = this.props.standingBookStore; const { billMonth, selectedKey } = this.props; if (selectedKey === "1") { siaccountCommonForm(); @@ -247,86 +283,98 @@ export default class NormalIndex extends Component { addProps: { ...this.state.addProps, title: "添加缴纳人员", - visible: true, - }, + visible: true + } }); }; // 核算按钮点击 handleCommonAccountClick() { const { remarks, billMonth, selectedKey, paymentOrganization } = this.props; - const { commonAccount } = - this.props.standingBookStore; + const { commonAccount } = this.props.standingBookStore; commonAccount({ - billMonth, includes: [] + billMonth, + includes: [] }).then(() => { selectedKey === "1" - ? this.getNormalList({ billMonth, paymentOrganization, current: this.state.current }) - : this.getSupplementaryList({ billMonth, paymentOrganization, current: this.state.current }); - }) + ? this.getNormalList({ + billMonth, + paymentOrganization, + current: this.state.current + }) + : this.getSupplementaryList({ + billMonth, + paymentOrganization, + current: this.state.current + }); + }); } render() { const { remarks, billMonth, selectedKey } = this.props; const { selectedRowKeys, addProps, date } = this.state; - const { loading, form, condition, saveLoading } = - this.props.standingBookStore; + const { + loading, + form, + condition, + saveLoading + } = this.props.standingBookStore; let { list, columns, total } = this.state.tableData; const rowSelection = { selectedRowKeys, - onChange: this.onSelectChange, + onChange: this.onSelectChange }; const pagination = { total, current: this.state.current, - showTotal: (total) => `共 ${total} 条`, - onChange: (current) => { + showTotal: total => `共 ${total} 条`, + onChange: current => { this.setState({ current }); selectedKey === "1" ? this.getNormalList({ billMonth, current }) : this.getSupplementaryList({ billMonth, - current, + current }); - }, + } }; return (
- {selectedKey === "1" && ( + {selectedKey === "1" &&
账单月份 - + - {billMonth} + + {billMonth} +
备注: - {remarks} + + {remarks} +
-
- )} +
}
- { - this.props.type !== "detail" && this.props.selectedKey == "3" ? - - - - - - - - : - } - - {addProps.visible && ( + {this.props.type !== "detail" && this.props.selectedKey == "3" + ? + + + + + + + + : } + + {addProps.visible && @@ -334,10 +382,9 @@ export default class NormalIndex extends Component { addProps: { ...addProps, title: "", - visible: false, - }, - }) - } + visible: false + } + })} buttons={[ , - , + ]}> {getSearchs(form, toJS(condition), 1)} - - )} + } {/* {selectedKey === "3" && ( @@ -359,8 +405,16 @@ export default class NormalIndex extends Component { */} {/* {selectedKey === "1" && this.props.type !== "detail" && } */} - - {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/> + + { + this.setState({ searchValue: value }); + }} + onSearch={value => { + this.handleSearch(value); + }} + />
{/* table */}
@@ -372,7 +426,7 @@ export default class NormalIndex extends Component { loading={loading} pagination={pagination} rowSelection={rowSelection} - scroll={{ x: 1200 }} + scroll={{ x: 1200, y: 300 }} />
diff --git a/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js b/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js index 69b7255b..2f550bb9 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 个税扣缴义务人-人员范围 * Date: 2022-05-31 09:51:59 - * LastEditTime: 2022-06-01 17:57:42 + * LastEditTime: 2022-06-28 17:43:30 */ import React, { Component } from "react"; import { message, Modal } from "antd"; @@ -140,7 +140,7 @@ export default class PersonalScope extends Component { const { taxAgentRangeSave } = this.props.taxAgentStore; this.setState({ submitLoading: true }); taxAgentRangeSave({ ...module, taxAgentId }).then( - ({ status, errorMsg }) => { + ({ status, errormsg }) => { this.setState({ submitLoading: false }); if (status) { this.tagAgentRef.closeModal(); @@ -155,7 +155,7 @@ export default class PersonalScope extends Component { pageSize: pageObj.pageSize, }); } else { - message.error(errorMsg || "新增失败"); + message.error(errormsg || "新增失败"); } } ); diff --git a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js index 9ef9ca6a..cccc4707 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js @@ -10,7 +10,7 @@ export default class SlideTaxagentUser extends React.Component { addTaxagentModalVisible: false, includeType: 1, selectedRowKeys: [], - searchValue: "", + searchValue: "" }; } @@ -18,7 +18,7 @@ export default class SlideTaxagentUser extends React.Component { const { onChangeTab } = this.props; this.setState( { - includeType, + includeType }, () => { onChangeTab && onChangeTab(includeType); @@ -26,7 +26,7 @@ export default class SlideTaxagentUser extends React.Component { ); } - onSelectChange = (selectedRowKeys) => { + onSelectChange = selectedRowKeys => { this.setState({ selectedRowKeys }); }; @@ -40,18 +40,18 @@ export default class SlideTaxagentUser extends React.Component { onDeleteTaxAgent({ ids: this.state.selectedRowKeys, tab: includeType }); }; - handleSearch = (value) => { + handleSearch = value => { const { includeType } = this.state; const { onTaxAngetSearch } = this.props; onTaxAngetSearch({ tab: includeType, - targetName: value, + targetName: value }); }; closeModal = () => { this.setState({ - addTaxagentModalVisible: false, + addTaxagentModalVisible: false }); }; @@ -60,7 +60,7 @@ export default class SlideTaxagentUser extends React.Component { includeType, selectedRowKeys, searchValue, - addTaxagentModalVisible, + addTaxagentModalVisible } = this.state; const { submitLoading, @@ -71,16 +71,16 @@ export default class SlideTaxagentUser extends React.Component { setPageObj, employeeStatus, targetTypeList, - onTaxAgentSave, + onTaxAgentSave } = this.props; const rowSelection = { selectedRowKeys, - onChange: this.onSelectChange, + onChange: this.onSelectChange }; const pagination = { total: pageObj.total, - showTotal: (total) => `共 ${total} 条`, + showTotal: total => `共 ${total} 条`, showSizeChanger: true, onShowSizeChange: (current, pageSize) => { setPageObj && @@ -88,17 +88,17 @@ export default class SlideTaxagentUser extends React.Component { current, pageSize, tab: includeType, - targetName: searchValue, + targetName: searchValue }); }, - onChange: (current) => { + onChange: current => { setPageObj && setPageObj({ current, tab: includeType, - targetName: searchValue, + targetName: searchValue }); - }, + } }; return ( @@ -110,28 +110,26 @@ export default class SlideTaxagentUser extends React.Component { paddingLeft: "10px", paddingRight: "10px", display: "flex", - justifyContent: "space-between", + justifyContent: "space-between" }}>
{ this.handleTabClick(1); }}> - 关联人员范围 - {" "} - {" "} | {" "}{" "} - | { this.handleTabClick(0); @@ -144,7 +142,7 @@ export default class SlideTaxagentUser extends React.Component { style={{ color: "#4ba9f2", display: "inlineBlock", - float: "left", + float: "left" }}> { + onChange={value => { this.setState({ searchValue: value }); }} - onSearch={(value) => { + onSearch={value => { this.handleSearch(value); }} />
-
+
+ onTaxAgentSave={val => onTaxAgentSave && - onTaxAgentSave({ ...val, includeType: includeType }) - } + onTaxAgentSave({ ...val, includeType: includeType })} visible={addTaxagentModalVisible} onCancel={() => { this.setState({ addTaxagentModalVisible: false }); diff --git a/pc4mobx/hrmSalary/stores/attendanceStore.js b/pc4mobx/hrmSalary/stores/attendanceStore.js index 9cf12795..8066e6dd 100644 --- a/pc4mobx/hrmSalary/stores/attendanceStore.js +++ b/pc4mobx/hrmSalary/stores/attendanceStore.js @@ -50,31 +50,31 @@ export class AttendanceStore { // ** 设置导入参数 start ** @action - setPreviewAttendQuoteColumns = (previewAttendQuoteColumns) => { + setPreviewAttendQuoteColumns = previewAttendQuoteColumns => { this.previewAttendQuoteColumns = previewAttendQuoteColumns; }; @action - setPreviewAttendQuoteDataSource = (previewAttendQuoteDataSource) => { + setPreviewAttendQuoteDataSource = previewAttendQuoteDataSource => { this.previewAttendQuoteDataSource = previewAttendQuoteDataSource; }; @action - setImportResult = (importResult) => { + setImportResult = importResult => { this.importResult = importResult; }; // ** 设置导入参数 end ** @action - searchFieldSettingList = (value) => { + searchFieldSettingList = value => { if (value != "") { let requestFeildAttendList = [...this.requestFeildAttendList]; this.fieldSettingAttendList = requestFeildAttendList.filter( - (item) => item.name.indexOf(value) > -1 + item => item.name.indexOf(value) > -1 ); let requestFeildCustomList = [...this.requestFeildCustomList]; this.fieldSettingCustomList = requestFeildCustomList.filter( - (item) => item.name.indexOf(value) > -1 + item => item.name.indexOf(value) > -1 ); } else { this.fieldSettingAttendList = [...this.requestFeildAttendList]; @@ -83,11 +83,11 @@ export class AttendanceStore { }; @action - setFieldSettingAttendList = (fieldSettingAttendList) => { + setFieldSettingAttendList = fieldSettingAttendList => { this.fieldSettingAttendList = fieldSettingAttendList; let requestFeildAttendList = [...this.requestFeildAttendList]; - requestFeildAttendList.map((item) => { - this.fieldSettingAttendList.map((inner) => { + requestFeildAttendList.map(item => { + this.fieldSettingAttendList.map(inner => { if (inner.id == item.id && inner.checked != item.checked) { item.checked = inner.checked; } @@ -97,11 +97,11 @@ export class AttendanceStore { }; @action - setFieldSettingCustomList = (fieldSettingCustomList) => { + setFieldSettingCustomList = fieldSettingCustomList => { this.fieldSettingCustomList = fieldSettingCustomList; let requestFeildCustomList = [...this.requestFeildCustomList]; - requestFeildCustomList.map((item) => { - this.fieldSettingCustomList.map((inner) => { + requestFeildCustomList.map(item => { + this.fieldSettingCustomList.map(inner => { if (inner.id == item.id && inner.checked != item.checked) { item.checked = inner.checked; } @@ -109,21 +109,19 @@ export class AttendanceStore { }); }; - @action - setCurrentItem = (currentItem) => (this.currentItem = currentItem); + @action setCurrentItem = currentItem => (this.currentItem = currentItem); @action - setCurrentItemOperate = (currentItemOperate) => + setCurrentItemOperate = currentItemOperate => (this.currentItemOperate = currentItemOperate); @action - setSlideVisiable = (slideVisiable) => (this.slideVisiable = slideVisiable); + setSlideVisiable = slideVisiable => (this.slideVisiable = slideVisiable); + + @action setStep = step => (this.step = step); @action - setStep = (step) => (this.step = step); - - @action - setModalVisiable = (modalVisiable) => (this.modalVisiable = modalVisiable); + setModalVisiable = modalVisiable => (this.modalVisiable = modalVisiable); // 初始化操作 @action @@ -138,7 +136,7 @@ export class AttendanceStore { @action getCondition = () => { API.getCondition().then( - action((res) => { + action(res => { if (res.api_status) { // 接口请求成功/失败处理 this.condition = res.condition; @@ -152,12 +150,12 @@ export class AttendanceStore { // 渲染table数据 @action - getTableDatas = (params) => { + getTableDatas = params => { this.loading = true; const formParams = this.form.getFormParams() || {}; params = params || formParams; API.getTableDatas(params).then( - action((res) => { + action(res => { if (res.api_status) { // 接口请求成功/失败处理 this.tableStore.getDatas(res.datas); // table 请求数据 @@ -170,19 +168,20 @@ export class AttendanceStore { ); }; - @action - setShowSearchAd = (bool) => (this.showSearchAd = bool); + @action setShowSearchAd = bool => (this.showSearchAd = bool); // 高级搜索 - 搜索 - @action doSearch = () => { + @action + doSearch = () => { this.getTableDatas(); this.showSearchAd = false; }; // 字段列表 - @action getAttendanceFieldList = (params) => { + @action + getAttendanceFieldList = params => { this.loading = true; - API.getAttendanceFieldList(params).then((res) => { + API.getAttendanceFieldList(params).then(res => { if (res.status) { // 接口请求成功/失败处理 this.fieldTableStore.getDatas(res.data.dataKey.datas); // table 请求数据 @@ -195,8 +194,9 @@ export class AttendanceStore { }); }; - @action saveAttendanceField = (params) => { - API.saveAttendanceField(params).then((res) => { + @action + saveAttendanceField = params => { + API.saveAttendanceField(params).then(res => { if (res.status) { message.success("保存成功"); } else { @@ -205,8 +205,9 @@ export class AttendanceStore { }); }; - @action deleteAttendanceField = (params) => { - API.deleteAttendanceField(params).then((res) => { + @action + deleteAttendanceField = params => { + API.deleteAttendanceField(params).then(res => { if (res.status) { message.success("删除成功"); } else { @@ -223,7 +224,7 @@ export class AttendanceStore { message.warning("未选择任何条目"); return; } - API.deleteAttendanceField(this.tableStore.selectedRowKeys).then((res) => { + API.deleteAttendanceField(this.tableStore.selectedRowKeys).then(res => { if (res.status) { message.success("删除成功"); } else { @@ -234,8 +235,8 @@ export class AttendanceStore { // 更新 @action - updateAttendanceField = (params) => { - API.updateAttendanceField(params).then((res) => { + updateAttendanceField = params => { + API.updateAttendanceField(params).then(res => { if (res.status) { message.success("修改成功"); } else { @@ -246,8 +247,8 @@ export class AttendanceStore { // 更新状态 @action - updateAttendanceFieldStatus = (params) => { - return API.updateAttendanceFieldStatus(params).then((res) => { + updateAttendanceFieldStatus = params => { + return API.updateAttendanceFieldStatus(params).then(res => { if (res.status) { message.success("修改成功"); return new Promise((resolve, reject) => { @@ -264,9 +265,9 @@ export class AttendanceStore { // 考勤数据列表 @action - getAttendanceList = (params) => { + getAttendanceList = params => { this.loading = true; - API.getAttendanceList(params).then((res) => { + API.getAttendanceList(params).then(res => { if (res.status) { // 接口请求成功/失败处理 // this.attendTableStore.getDatas(res.data.datas); // table 请求数据 @@ -279,12 +280,17 @@ export class AttendanceStore { this.loading = false; }); }; + // 删除考勤列表数据 + @action + deleteAttendance = params => { + return API.deleteAttendance(params); + }; //数据采集-考勤引用-考勤引用字段设置-列表 @action - getAttendanceFieldSettingList = (params) => { + getAttendanceFieldSettingList = params => { this.loading = true; - API.getAttendanceFieldSettingList(params).then((res) => { + API.getAttendanceFieldSettingList(params).then(res => { if (res.status) { this.requestFeildAttendList = res.data[0] ? res.data[0].items : []; this.fieldSettingAttendList = this.requestFeildAttendList; @@ -300,19 +306,19 @@ export class AttendanceStore { //数据采集-考勤引用-考勤引用字段设置-保存 @action saveAttendanceFieldSetting = (sourceType = "IMPORT") => { - let attendList = this.requestFeildAttendList.map((item) => ({ + let attendList = this.requestFeildAttendList.map(item => ({ id: item.id, - checked: item.checked, + checked: item.checked })); - let customList = this.requestFeildCustomList.map((item) => ({ + let customList = this.requestFeildCustomList.map(item => ({ id: item.id, - checked: item.checked, + checked: item.checked })); let request = { sourceType: sourceType, - currentSettingFields: [...attendList, ...customList], + currentSettingFields: [...attendList, ...customList] }; - API.saveAttendanceFieldSetting(request).then((res) => { + API.saveAttendanceFieldSetting(request).then(res => { if (res.status) { message.success("保存成功"); } else { @@ -324,36 +330,36 @@ export class AttendanceStore { //数据采集-考勤引用-考勤引用字段设置-恢复默认设置 @action returnToAttendanceFieldSettingDefault = (sourceType = "IMPORT") => { - API.returnToAttendanceFieldSettingDefault({ sourceType: sourceType }).then( - (res) => { - if (res.status) { - this.requestFeildAttendList = res.data[0] ? res.data[0].items : []; - this.fieldSettingAttendList = this.requestFeildAttendList; - this.requestFeildCustomList = res.data[1] ? res.data[1].items : []; - this.fieldSettingCustomList = this.requestFeildCustomList; - } else { - message.error(res.errormsg || "获取数据失败"); - } + API.returnToAttendanceFieldSettingDefault({ + sourceType: sourceType + }).then(res => { + if (res.status) { + this.requestFeildAttendList = res.data[0] ? res.data[0].items : []; + this.fieldSettingAttendList = this.requestFeildAttendList; + this.requestFeildCustomList = res.data[1] ? res.data[1].items : []; + this.fieldSettingCustomList = this.requestFeildCustomList; + } else { + message.error(res.errormsg || "获取数据失败"); } - ); + }); }; //数据采集-考勤引用-考勤引用字段设置-设为默认设置 @action saveAttendanceFieldSettingAsDefault = (sourceType = "IMPORT") => { - let attendList = this.requestFeildAttendList.map((item) => ({ + let attendList = this.requestFeildAttendList.map(item => ({ id: item.id, - checked: item.checked, + checked: item.checked })); - let customList = this.requestFeildCustomList.map((item) => ({ + let customList = this.requestFeildCustomList.map(item => ({ id: item.id, - checked: item.checked, + checked: item.checked })); let request = { sourceType: sourceType, - currentSettingFields: [...attendList, ...customList], + currentSettingFields: [...attendList, ...customList] }; - API.saveAttendanceFieldSettingAsDefault(request).then((res) => { + API.saveAttendanceFieldSettingAsDefault(request).then(res => { if (res.status) { message.success("设置成功"); } else { @@ -366,7 +372,7 @@ export class AttendanceStore { @action getLedgerList = () => { return new Promise((resolve, reject) => { - API.getLedgerList({}).then((res) => { + API.getLedgerList({}).then(res => { if (res.status) { this.importLedgerList = res.data; resolve(this.importLedgerList); @@ -386,8 +392,8 @@ export class AttendanceStore { // 导入预览 @action - previewAttendQuote = (params) => { - API.previewAttendQuote(params).then((res) => { + previewAttendQuote = params => { + API.previewAttendQuote(params).then(res => { if (res.status) { this.previewAttendQuoteList = res.data; this.previewAttendQuoteColumns = res.data.headers.map((item, index) => { @@ -398,7 +404,7 @@ export class AttendanceStore { return column; }); - this.previewAttendQuoteDataSource = res.data.list.map((item) => { + this.previewAttendQuoteDataSource = res.data.list.map(item => { let data = {}; item.map((i, index) => { data[index + ""] = i; @@ -413,8 +419,8 @@ export class AttendanceStore { // 考勤导入 @action - importAttendQuoteData = (params) => { - API.importAttendQuoteData(params).then((res) => { + importAttendQuoteData = params => { + API.importAttendQuoteData(params).then(res => { if (res.status) { this.importResult = res.data; } else { @@ -426,7 +432,7 @@ export class AttendanceStore { // 考勤数据详情 @action viewAttendQuote = (params = {}) => { - API.viewAttendQuote(params).then((res) => { + API.viewAttendQuote(params).then(res => { if (res.status) { this.attendQuoteDetailPageInfo = res.data.pageInfo; this.attendQuoteDetailTableStore.getDatas(res.data.dataKey.datas); @@ -438,9 +444,9 @@ export class AttendanceStore { // 考勤引用同步 @action - syncAttendanceRefer = (params) => { + syncAttendanceRefer = params => { return new Promise((resolve, reject) => { - API.syncAttendanceRefer(params).then((res) => { + API.syncAttendanceRefer(params).then(res => { if (res.status) { message.success("同步成功"); resolve(); @@ -453,21 +459,22 @@ export class AttendanceStore { }; // 考勤引用同步 @action - checkOperation = (params) => { + checkOperation = params => { return API.checkOperation(params); }; // 根据所属月和账套获取周期 @action getSalaryCycleAndAttendCycle = (salaryYearMonthStr, salarySobId) => { - API.getSalaryCycleAndAttendCycle({ salaryYearMonthStr, salarySobId }).then( - (res) => { - if (res.status) { - this.cycle = res.data; - } else { - message.error(res.errormsg || "获取失败"); - } + API.getSalaryCycleAndAttendCycle({ + salaryYearMonthStr, + salarySobId + }).then(res => { + if (res.status) { + this.cycle = res.data; + } else { + message.error(res.errormsg || "获取失败"); } - ); + }); }; } diff --git a/pc4mobx/hrmSalary/stores/cumSituation.js b/pc4mobx/hrmSalary/stores/cumSituation.js index 4798c062..00b2b583 100644 --- a/pc4mobx/hrmSalary/stores/cumSituation.js +++ b/pc4mobx/hrmSalary/stores/cumSituation.js @@ -75,8 +75,8 @@ export class CumSituationStore { // 初始化操作 @action - doInit = (params = {}) => { - this.getCondition(); + doInit = async (params = {}) => { + await this.getCondition(); this.getTableDatas(params); }; diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index b1c23142..32d779f3 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -167,7 +167,7 @@ export class TaxAgentStore { this.taxAgentOption = res.data.map(item => { return { key: item.id, showname: item.content }; }); - resolve(); + resolve(res); } else { message.error(res.errormsg || "获取失败"); reject();