diff --git a/pc4mobx/hrmSalary/common/columns.js b/pc4mobx/hrmSalary/common/columns.js new file mode 100644 index 00000000..3d539244 --- /dev/null +++ b/pc4mobx/hrmSalary/common/columns.js @@ -0,0 +1,37 @@ +export const logColumns = [ + { + title: "操作时间", + dataIndex: 'title', + key: 'title', + }, + { + title: "操作人", + dataIndex: 'title', + key: 'title', + }, + { + title: "操作类型", + dataIndex: 'title', + key: 'title', + }, + { + title: "模块", + dataIndex: 'title', + key: 'title', + }, + { + title: "对象", + dataIndex: 'title', + key: 'title', + }, + { + title: "修改详情", + dataIndex: 'title', + key: 'title', + }, + { + title: "客户端IP", + dataIndex: 'title', + key: 'title', + } +] \ No newline at end of file diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 2b688a29..93761f02 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -1,7 +1,7 @@ import React from 'react'; import Route from 'react-router/lib/Route'; import { WeaLocaleProvider } from 'ecCom' -import MySalaryBenefits from './pages/mySalaryBenefits'; +import MySalary from './pages/mySalary'; import Programme from './pages/socialSecurityBenefits/programme'; import Archives from './pages/socialSecurityBenefits/archives'; import StandingBook from './pages/socialSecurityBenefits/standingBook'; @@ -16,7 +16,7 @@ import SalaryAccounting from './pages/salaryAccounting'; import PayrollPayment from './pages/payrollPayment'; import IndividualIncomeTaxApplicationForm from './pages/individualIncomeTaxApplicationForm'; import IndividualIncomeTaxRateForm from './pages/individualIncomeTaxRateForm'; -import IndividualIncomeTaxWithholdingAgent from './pages/individualIncomeTaxWithholdingAgent'; +import TaxAgent from './pages/taxAgent'; import BaseForm from './components'; @@ -54,11 +54,11 @@ const DataAcquisition = props => props.children; // payrollPayment 工资单发放 // individualIncomeTaxApplicationForm 个税申请表 // individualIncomeTaxRateForm 个税税率表 -// individualIncomeTaxWithholdingAgent 个税扣缴义务人 +// taxAgent 个税扣缴义务人 const Routes = ( - + @@ -77,7 +77,7 @@ const Routes = ( - + ); diff --git a/pc4mobx/hrmSalary/pages/individualIncomeTaxWithholdingAgent/index.js b/pc4mobx/hrmSalary/pages/individualIncomeTaxWithholdingAgent/index.js deleted file mode 100644 index cfbfdc93..00000000 --- a/pc4mobx/hrmSalary/pages/individualIncomeTaxWithholdingAgent/index.js +++ /dev/null @@ -1,84 +0,0 @@ -import React from 'react'; -import { inject, observer } from 'mobx-react'; -import { toJS } from 'mobx'; - -import { Button, Table, DatePicker } from 'antd'; - -import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaTable } from 'ecCom'; - -import { renderNoright, getSearchs } from '../../util'; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 -import CustomTab from '../../components/customTab'; -import ContentWrapper from '../../components/contentWrapper'; - -import { columns, dataSource } from './columns'; - -const { MonthPicker } = DatePicker; - -@inject('baseTableStore') -@observer -export default class IndividualIncomeTaxWithholdingAgent extends React.Component { - constructor(props) { - super(props); - this.state = { - value: "", - selectedKey: "0" - } - } - render() { - const { baseTableStore } = this.props; - const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = baseTableStore; - - if (!hasRight && !loading) { // 无权限处理 - return renderNoright(); - } - - const rightMenu = [// 右键菜单 - { - key: 'BTN_COLUMN', - icon: , - content: '显示列定制', - onClick: this.showColumn - }, - ]; - const collectParams = { // 收藏功能配置 - favname: '个税扣缴义务人', - favouritetype: 1, - objid: 0, - link: 'wui/index.html#/ns_demo03/index', - importantlevel: 1, - }; - const adBtn = [ // 高级搜索内部按钮 - , - , - , - ]; - - const topTab = [ - ]; - - const renderSearchOperationItem = () => { - return
- - } - - return ( -
- - } // 左侧图标 - iconBgcolor='#F14A2D' // 左侧图标背景色 - showDropIcon={true} // 是否显示下拉按钮 - dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同) - dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 - > - - - -
- ) - } -} diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/columns.js b/pc4mobx/hrmSalary/pages/mySalary/columns.js similarity index 100% rename from pc4mobx/hrmSalary/pages/mySalaryBenefits/columns.js rename to pc4mobx/hrmSalary/pages/mySalary/columns.js diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js b/pc4mobx/hrmSalary/pages/mySalary/index.js similarity index 88% rename from pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js rename to pc4mobx/hrmSalary/pages/mySalary/index.js index e8583b68..2c3ae5bf 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js +++ b/pc4mobx/hrmSalary/pages/mySalary/index.js @@ -18,9 +18,9 @@ import { payrollColumns, const { MonthPicker } = DatePicker; -@inject('baseTableStore') +@inject('mySalaryStore') @observer -export default class MySalaryBenefits extends React.Component { +export default class MySalary extends React.Component { constructor(props) { super(props); this.state = { @@ -29,8 +29,9 @@ export default class MySalaryBenefits extends React.Component { } } render() { - const { baseTableStore } = this.props; - const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = baseTableStore; + const { mySalaryStore } = this.props; + const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = mySalaryStore; + const { tabIndex } = mySalaryStore if (!hasRight && !loading) { // 无权限处理 return renderNoright(); @@ -127,15 +128,18 @@ export default class MySalaryBenefits extends React.Component { this.setState({selectedKey: v}) }} /> - { - this.state.selectedKey == '0' && - } + { this.state.selectedKey == '1' && } { this.state.selectedKey == '2' && } + diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.less b/pc4mobx/hrmSalary/pages/mySalary/index.less similarity index 100% rename from pc4mobx/hrmSalary/pages/mySalaryBenefits/index.less rename to pc4mobx/hrmSalary/pages/mySalary/index.less diff --git a/pc4mobx/hrmSalary/pages/individualIncomeTaxWithholdingAgent/columns.js b/pc4mobx/hrmSalary/pages/taxAgent/columns.js similarity index 100% rename from pc4mobx/hrmSalary/pages/individualIncomeTaxWithholdingAgent/columns.js rename to pc4mobx/hrmSalary/pages/taxAgent/columns.js diff --git a/pc4mobx/hrmSalary/pages/taxAgent/index.js b/pc4mobx/hrmSalary/pages/taxAgent/index.js new file mode 100644 index 00000000..84e29886 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/taxAgent/index.js @@ -0,0 +1,257 @@ +import React from 'react'; +import { inject, observer } from 'mobx-react'; +import { toJS } from 'mobx'; + +import { Button, Table, DatePicker, Row, Col, Modal, Form, Input } from 'antd'; +const { TextArea } = Input; + +import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaTable, WeaInputSearch, WeaInput, WeaTextarea } from 'ecCom'; + +import { renderNoright, getSearchs } from '../../util'; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 +import CustomTab from '../../components/customTab'; +import ContentWrapper from '../../components/contentWrapper'; +import "./index.less" + +import { columns, dataSource } from './columns'; + +import { logColumns } from '../../common/columns' + +const { MonthPicker } = DatePicker; + +@inject('taxAgentStore') +@observer +export default class TaxAgent extends React.Component { + constructor(props) { + super(props); + this.state = { + value: "", + selectedKey: "0", + searchValue: "", + logViewVisiable: false + } + } + + showLogView = () => { + this.setState({logViewVisiable: true}) + } + + render() { + const { taxAgentStore } = this.props; + const { loading, hasRight, form, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = taxAgentStore; + const { modelVisiable, setModelVisiable } = taxAgentStore; + // const { condition } = baseFormStore + + const topTab = [ + ]; + + + + if (!hasRight && !loading) { // 无权限处理 + return renderNoright(); + } + + const rightMenu = [// 右键菜单 + { + key: 'BTN_COLUMN', + icon: , + content: '操作日志', + onClick: this.showLogView + }, + ]; + const collectParams = { // 收藏功能配置 + favname: '个税扣缴义务人', + favouritetype: 1, + objid: 0, + link: 'wui/index.html#/ns_demo03/index', + importantlevel: 1, + }; + const adBtn = [ // 高级搜索内部按钮 + , + , + , + ]; + + const renderSearchOperationItem = () => { + return
+ + {' '} + +
+ } + + const renderTipsLabel = () => { + const tipList = [ + "1、个税扣缴义务人与档案中的个税扣缴义务人匹配,修改个税扣缴义务人名称,薪资档案的个税扣缴义务人数据同步更新;", + "2、删除个税扣缴义务人需先确认档案里无人员使用该个税扣缴义务人,否则不予删除;" + ] + return ( +
+
+ 小提示 +
+
+ {tipList.map(item =>
{item}
)} +
+
+ ) + } + + return ( +
+ + } // 左侧图标 + iconBgcolor='#F14A2D' // 左侧图标背景色 + showDropIcon={true} // 是否显示下拉按钮 + dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同) + dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 + > + { + this.setState({ selectedKey: v }) + }} + /> + + + + + + {renderTipsLabel()} + + + + + + + alert("ok")} onCancel={() => setModelVisiable(false)} + > + + +
名称:
+ + + { + console.log(value); + this.setState({ value }); + }} + customBlur={v => { + console.log("custom blur", v); + }} + onFocus={v => console.log("focus", v)} + onBlur={v => console.log("blur", v)} + /> + + + +
+ + + +
备注:
+ + + { this.setState({ value }) }} /> + +
+
+ + + alert("ok")} onCancel={()=>{this.setState({logViewVisiable: false})}} + className="logViewModal" + style={{ top: 150 }} + width={'80%'} height={'50%'} + > +
+
+
操作时间
+
+ this.setState({ value: v })} + /> +
+
+
+
操作人
+
+ { + console.log(value); + this.setState({ value }); + }} + customBlur={v => { + console.log("custom blur", v); + }} + onFocus={v => console.log("focus", v)} + onBlur={v => console.log("blur", v)} + /> +
+
+ +
+
对象
+
+ { + console.log(value); + this.setState({ value }); + }} + customBlur={v => { + console.log("custom blur", v); + }} + onFocus={v => console.log("focus", v)} + onBlur={v => console.log("blur", v)} + /> +
+
+ +
+
操作类型
+
+ { + console.log(value); + this.setState({ value }); + }} + customBlur={v => { + console.log("custom blur", v); + }} + onFocus={v => console.log("focus", v)} + onBlur={v => console.log("blur", v)} + /> +
+
+ +
+ +
+
+ +
+
+ ) + } +} diff --git a/pc4mobx/hrmSalary/pages/taxAgent/index.less b/pc4mobx/hrmSalary/pages/taxAgent/index.less new file mode 100644 index 00000000..8d57b634 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/taxAgent/index.less @@ -0,0 +1,52 @@ +.tipLabelWrapper { + border-left: 1px solid #e2ecf2; + border-bottom: 1px solid #e2ecf2; + border-right: 1px solid #e2ecf2; + border-radius: 0px 0px 5px 5px; + .titleWrapper { + width: 100%; + line-height: 19.2px; + padding: 10px; + border-bottom: 1px solid #e2ecf2; + background-color: #f7fbfe; + } + .tipContentWrapper { + padding-bottom: 10px; + } + .tipContentItem { + line-height: 20px; + padding: 0px 16px; + padding-top: 10px; + color: rgb(153, 153, 153); + } + .tipContentItem:first { + padding-top: 0px; + } + + .formLabel { + font-size: 14px; + } + +} + +.logViewModal { + .searchBar { + display: flex; + } + .searchBarLabel { + margin-bottom: 10px; + } + .searchBarItem { + position: relative; + width: 200px; + margin-left: 10px; + margin-right: 10px; + } + .searchDateRange { + width: 300px; + } + .searchBtn { + position: absolute; + bottom: 0px; + } +} diff --git a/pc4mobx/hrmSalary/stores/baseFoom.js b/pc4mobx/hrmSalary/stores/baseForm.js similarity index 100% rename from pc4mobx/hrmSalary/stores/baseFoom.js rename to pc4mobx/hrmSalary/stores/baseForm.js diff --git a/pc4mobx/hrmSalary/stores/index.js b/pc4mobx/hrmSalary/stores/index.js index 22a9598f..0644ebe3 100644 --- a/pc4mobx/hrmSalary/stores/index.js +++ b/pc4mobx/hrmSalary/stores/index.js @@ -1,7 +1,13 @@ import { BaseTableStore } from './baseTable'; +import { MySalaryStore } from'./mySalary'; +import { TaxAgentStore } from './taxAgent'; +import { BaseFormStore } from './baseForm'; module.exports = { + baseFormStore: new BaseFormStore(), baseTableStore: new BaseTableStore(), + mySalaryStore: new MySalaryStore(), + taxAgentStore: new TaxAgentStore() }; diff --git a/pc4mobx/hrmSalary/stores/mySalary.js b/pc4mobx/hrmSalary/stores/mySalary.js new file mode 100644 index 00000000..15ba00bf --- /dev/null +++ b/pc4mobx/hrmSalary/stores/mySalary.js @@ -0,0 +1,92 @@ +import { observable, action, toJS } from 'mobx'; +import { message } from 'antd'; +import { WeaForm, WeaLogView } from 'comsMobx'; +import { WeaLocaleProvider } from 'ecCom'; +import moment from 'moment' + +import * as API from '../apis/mySalaryBenefits'; // 引入API接口文件 + +const {LogStore} = WeaLogView; +const getLabel = WeaLocaleProvider.getLabel; + +export class MySalaryStore { + @observable tableStore = new TableStore(); // new table + @observable form = new WeaForm(); // nrew 一个form + @observable condition = []; // 存储后台得到的form数据 + @observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据 + @observable showSearchAd = false; // 高级搜索面板显示 + @observable loading = true; // 数据加载状态 + @observable tabIndex = 0; // tab选中坐标 + @observable params = {}; // 搜索条件 + + + @action + initParams = () => { + let month = moment().format("YYYY-MM") + this.params = {startMonth: month, endMonth: month} + return this.params; + } + + @action + setTabIndex = index => { + this.tabIndex = index + this.getTableDatas(index); + } + + // 初始化操作 + @action + doInit = () => { + this. + this.getTableDatas(0, params); + } + + // 获得高级搜索表单数据 + @action + getCondition = () => { + API.getCondition().then(action(res => { + if (res.api_status) { // 接口请求成功/失败处理 + this.condition = res.condition; + this.form.initFormFields(res.condition); // 渲染高级搜索form表单 + } else { + message.error(res.msg || '接口调用失败!') + } + })); + } + + // 渲染table数据 + @action + getTableDatas = (params) => { + this.loading = true; + const formParams = this.form.getFormParams() || {}; + params = params || formParams; + switch(params) { + case 0: + // 工资单 + API.mySalaryBillList(param) + break; + } + if(params == 0) { + // 工资单 + + } + API.getTableDatas(params).then(action(res => { + if (res.api_status) { // 接口请求成功/失败处理 + this.tableStore.getDatas(res.datas); // table 请求数据 + this.hasRight = res.hasRight; + } else { + message.error(res.msg || '接口调用失败!') + } + this.loading = false; + })); + } + + @action + setShowSearchAd = bool => this.showSearchAd = bool; + + // 高级搜索 - 搜索 + @action doSearch = () => { + this.getTableDatas(); + this.showSearchAd = false; + } + +} \ No newline at end of file diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js new file mode 100644 index 00000000..53904327 --- /dev/null +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -0,0 +1,69 @@ +import { observable, action, toJS } from 'mobx'; +import { message } from 'antd'; +import { WeaForm, WeaTableNew } from 'comsMobx'; +import moment from 'moment' + +import * as API from '../apis'; // 引入API接口文件 + +const { TableStore } = WeaTableNew; + +export class TaxAgentStore { + @observable tableStore = new TableStore(); // new table + @observable form = new WeaForm(); // nrew 一个form + @observable condition = []; // 存储后台得到的form数据 + @observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据 + @observable showSearchAd = false; // 高级搜索面板显示 + @observable loading = true; // 数据加载状态 + + @observable modelVisiable = false; // 对话框显示隐藏 + + @action + setModelVisiable = visiable => this.modelVisiable = visiable + + // 初始化操作 + @action + doInit = () => { + this.getCondition(); + this.getTableDatas(); + } + + // 获得高级搜索表单数据 + @action + getCondition = () => { + API.getCondition().then(action(res => { + if (res.api_status) { // 接口请求成功/失败处理 + this.condition = res.condition; + this.form.initFormFields(res.condition); // 渲染高级搜索form表单 + } else { + message.error(res.msg || '接口调用失败!') + } + })); + } + + // 渲染table数据 + @action + getTableDatas = (params) => { + this.loading = true; + const formParams = this.form.getFormParams() || {}; + params = params || formParams; + API.getTableDatas(params).then(action(res => { + if (res.api_status) { // 接口请求成功/失败处理 + this.tableStore.getDatas(res.datas); // table 请求数据 + this.hasRight = res.hasRight; + } else { + message.error(res.msg || '接口调用失败!') + } + this.loading = false; + })); + } + + @action + setShowSearchAd = bool => this.showSearchAd = bool; + + // 高级搜索 - 搜索 + @action doSearch = () => { + this.getTableDatas(); + this.showSearchAd = false; + } + +} \ No newline at end of file