列表分页以及权限的修改

This commit is contained in:
liyongshun 2022-06-02 14:48:55 +08:00
parent 6adf1a83fa
commit 17e23fc014
32 changed files with 5339 additions and 2745 deletions

View File

@ -1,85 +1,102 @@
import { WeaTools } from 'ecCom';
import { WeaTools } from "ecCom";
//数据采集-累计专项附加扣除列表
export const getCumDeductList = params => {
return fetch('/api/bs/hrmsalary/addUpDeduction/list', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const getCumDeductList = (params) => {
return fetch("/api/bs/hrmsalary/addUpDeduction/list", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
//数据采集-累计专项附加扣除列表的高级搜索
export const getCumDeductSaCondition = params => {
return WeaTools.callApi('/api/bs/hrmsalary/addUpDeduction/getSearchCondition', 'get', params);
}
export const getCumDeductSaCondition = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/addUpDeduction/getSearchCondition",
"get",
params
);
};
//数据采集-累计专项附加扣除-导出
export const exportCumDeductList = (ids = "") => {
fetch('/api/bs/hrmsalary/addUpDeduction/export?ids=' + ids).then(res => res.blob().then(blob => {
var filename=`累计专项附加扣除.xlsx`
var a = document.createElement('a');
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
}))
}
fetch("/api/bs/hrmsalary/addUpDeduction/export?ids=" + ids).then((res) =>
res.blob().then((blob) => {
var filename = `累计专项附加扣除.xlsx`;
var a = document.createElement("a");
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
})
);
};
//数据采集-累计专项附加扣除-获取导入参数
export const getImportCumDeductParam = params => {
return WeaTools.callApi('/api/bs/hrmsalary/addUpDeduction/getImportParams', 'get', params);
}
export const getImportCumDeductParam = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/addUpDeduction/getImportParams",
"get",
params
);
};
//数据采集-获取累计专项附加扣除记录
export const getCumDeductDetailList = params => {
return fetch('/api/bs/hrmsalary/addUpDeduction/getDetailList', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const getCumDeductDetailList = (params) => {
return fetch("/api/bs/hrmsalary/addUpDeduction/getDetailList", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
//数据采集-累计专项附加扣除-导出明细
export const exportCumDeductDetailList = (id, ids="") => {
fetch('/api/bs/hrmsalary/addUpDeduction/exportDetail?accumulatedSpecialAdditionalDeductionId='+id+'&ids=' + ids).then(res => res.blob().then(blob => {
var filename=`累计专项附加扣除.xlsx`
var a = document.createElement('a');
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
}))
}
export const exportCumDeductDetailList = (id, ids = "") => {
fetch(
"/api/bs/hrmsalary/addUpDeduction/exportDetail?accumulatedSpecialAdditionalDeductionId=" +
id +
"&ids=" +
ids
).then((res) =>
res.blob().then((blob) => {
var filename = `累计专项附加扣除.xlsx`;
var a = document.createElement("a");
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
})
);
};
// 数据采集-获取累计专项附加扣除-导入
export const importCumDeductParam = params => {
return fetch('/api/bs/hrmsalary/addUpDeduction/importAddUpDeduction', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const importCumDeductParam = (params) => {
return fetch("/api/bs/hrmsalary/addUpDeduction/importAddUpDeduction", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
// 数据采集-获取累计专项附加扣除-导入预览
export const importCumDeductPreview = params => {
return fetch('/api/bs/hrmsalary/addUpDeduction/preview', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const importCumDeductPreview = (params) => {
return fetch("/api/bs/hrmsalary/addUpDeduction/preview", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};

View File

@ -1,85 +1,102 @@
import { WeaTools } from 'ecCom';
import { WeaTools } from "ecCom";
//数据采集-累计情况列表
export const getCumSituationList = params => {
return fetch('/api/bs/hrmsalary/addUpSituation/list', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const getCumSituationList = (params) => {
return fetch("/api/bs/hrmsalary/addUpSituation/list", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
//数据采集-累计情况列表的高级搜索
export const getCumSituationSaCondition = params => {
return WeaTools.callApi('/api/bs/hrmsalary/addUpSituation/getSearchCondition', 'get', params);
}
export const getCumSituationSaCondition = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/addUpSituation/getSearchCondition",
"get",
params
);
};
//数据采集-累计情况-导出
export const exportCumSituationList = ids => {
fetch('/api/bs/hrmsalary/addUpSituation/export?ids=' + ids).then(res => res.blob().then(blob => {
var filename=`往期累计情况(工资、薪金).xlsx`
var a = document.createElement('a');
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
}))
}
export const exportCumSituationList = (ids) => {
fetch("/api/bs/hrmsalary/addUpSituation/export?ids=" + ids).then((res) =>
res.blob().then((blob) => {
var filename = `往期累计情况(工资、薪金).xlsx`;
var a = document.createElement("a");
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
})
);
};
//数据采集-累计情况-获取导入参数
export const getImportCumSituationParam = params => {
return WeaTools.callApi('/api/bs/hrmsalary/addUpSituation/getImportParams', 'get', params);
}
export const getImportCumSituationParam = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/addUpSituation/getImportParams",
"get",
params
);
};
//数据采集-获取累计情况记录
export const getCumSituationDetailList = params => {
return fetch('/api/bs/hrmsalary/addUpSituation/getDetailList', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const getCumSituationDetailList = (params) => {
return fetch("/api/bs/hrmsalary/addUpSituation/getDetailList", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
//数据采集-累计情况-导出明细
export const exportCumSituationDetailList = (id, ids="") => {
fetch('/api/bs/hrmsalary/addUpSituation/exportDetail?accumulatedSituationId='+id+'&ids=' + ids).then(res => res.blob().then(blob => {
var filename=`往期累计情况(工资、薪金).xlsx`
var a = document.createElement('a');
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
}))
}
export const exportCumSituationDetailList = (id, ids = "") => {
fetch(
"/api/bs/hrmsalary/addUpSituation/exportDetail?accumulatedSituationId=" +
id +
"&ids=" +
ids
).then((res) =>
res.blob().then((blob) => {
var filename = `往期累计情况(工资、薪金).xlsx`;
var a = document.createElement("a");
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
})
);
};
// 数据采集-累计情况-导入
export const importCumSituationParam = params => {
return fetch('/api/bs/hrmsalary/addUpSituation/importAddUpSituation', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const importCumSituationParam = (params) => {
return fetch("/api/bs/hrmsalary/addUpSituation/importAddUpSituation", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
// 数据采集-累计情况-导入预览
export const importCumSituationPreview = params => {
return fetch('/api/bs/hrmsalary/addUpSituation/preview', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const importCumSituationPreview = (params) => {
return fetch("/api/bs/hrmsalary/addUpSituation/preview", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};

View File

@ -1,22 +1,21 @@
import { WeaTools } from 'ecCom';
import { WeaTools } from "ecCom";
// form基础数据
export const getBaseForm = params => {
return WeaTools.callApi('/api/demo01/getFormDemo', 'GET', params);
export const getBaseForm = (params) => {
return WeaTools.callApi("/api/demo01/getFormDemo", "GET", params);
};
// form保存
export const doSaveBaseSet = params => {
return WeaTools.callApi('/api/demo01/saveFormDemo', 'POST', params);
export const doSaveBaseSet = (params) => {
return WeaTools.callApi("/api/demo01/saveFormDemo", "POST", params);
};
// 获取高级搜索条件
export const getCondition = params => {
return WeaTools.callApi('/api/demo03/weatableConditonDemo', 'GET', params);
export const getCondition = (params) => {
return WeaTools.callApi("/api/demo03/weatableConditonDemo", "GET", params);
};
// 获取table数据
export const getTableDatas = params => {
return WeaTools.callApi('/api/demo03/weatableDemo', 'GET', params);
};
export const getTableDatas = (params) => {
return WeaTools.callApi("/api/demo03/weatableDemo", "GET", params);
};

View File

@ -1,88 +1,107 @@
import { WeaTools } from 'ecCom';
import { WeaTools } from "ecCom";
//数据采集-其他免税扣除列表
export const getOtherDeductList = params => {
return fetch('/api/bs/hrmsalary/otherDeduction/list', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const getOtherDeductList = (params) => {
return fetch("/api/bs/hrmsalary/otherDeduction/list", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
//数据采集-其他免税扣除列表的高级搜索
export const getOtherDeductSaCondition = params => {
return WeaTools.callApi('/api/bs/hrmsalary/otherDeduction/getSearchCondition', 'get', params);
}
export const getOtherDeductSaCondition = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/otherDeduction/getSearchCondition",
"get",
params
);
};
//数据采集-其他免税扣除-获取导入参数
export const getImportOtherDeductParam = params => {
return WeaTools.callApi('/api/bs/hrmsalary/otherDeduction/getImportParams', 'get', params);
}
export const getImportOtherDeductParam = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/otherDeduction/getImportParams",
"get",
params
);
};
//数据采集-其他免税扣除-导出
export const exportOtherDeductList = (ids = "") => {
fetch('/api/bs/hrmsalary/otherDeduction/export?ids=' + ids).then(res => res.blob().then(blob => {
var filename=`其他免税扣除.xlsx`
var a = document.createElement('a');
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
}))
return WeaTools.callApi('/api/bs/hrmsalary/otherDeduction/export', 'POST', params);
}
fetch("/api/bs/hrmsalary/otherDeduction/export?ids=" + ids).then((res) =>
res.blob().then((blob) => {
var filename = `其他免税扣除.xlsx`;
var a = document.createElement("a");
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
})
);
return WeaTools.callApi(
"/api/bs/hrmsalary/otherDeduction/export",
"POST",
params
);
};
//数据采集-获取其他免税扣除记录
export const getOtherDeductDetailList = params => {
return fetch('/api/bs/hrmsalary/otherDeduction/getDetailList', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const getOtherDeductDetailList = (params) => {
return fetch("/api/bs/hrmsalary/otherDeduction/getDetailList", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
//数据采集-其他免税扣除-导出明细
export const exportOtherDeductDetailList = (id, ids) => {
fetch('/api/bs/hrmsalary/otherDeduction/exportDetail?otherTaxExemptDeductionId='+id+'&ids=' + ids).then(res => res.blob().then(blob => {
var filename=`其他免税扣除.xlsx`
var a = document.createElement('a');
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
}))
}
fetch(
"/api/bs/hrmsalary/otherDeduction/exportDetail?otherTaxExemptDeductionId=" +
id +
"&ids=" +
ids
).then((res) =>
res.blob().then((blob) => {
var filename = `其他免税扣除.xlsx`;
var a = document.createElement("a");
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
})
);
};
// 数据采集-其他免税扣除-导入
export const importOtherDeductionParam = params => {
return fetch('/api/bs/hrmsalary/otherDeduction/importData', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const importOtherDeductionParam = (params) => {
return fetch("/api/bs/hrmsalary/otherDeduction/importData", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
// 数据采集-其他免税扣除-导入预览
export const importOtherDeductionPreview = params => {
return fetch('/api/bs/hrmsalary/otherDeduction/preview', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const importOtherDeductionPreview = (params) => {
return fetch("/api/bs/hrmsalary/otherDeduction/preview", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};

View File

@ -1,41 +1,86 @@
import { WeaTools } from 'ecCom';
import { formPost } from '../util/request';
import { WeaTools } from "ecCom";
import { formPost, postFetch } from "../util/request";
//个税扣缴义务人列表
export const getTaxAgentList = params => {
return WeaTools.callApi('/api/bs/hrmsalary/taxAgent/list', 'GET', params);
}
export const getTaxAgentList = (params) => {
return fetch("/api/bs/hrmsalary/taxAgent/list", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
// 系统管理员权限
export const getPermission = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/taxAgent/permission",
"GET",
params
);
};
//获取个税扣缴义务人表单
export const getTaxAgentForm = params => {
return WeaTools.callApi('/api/bs/hrmsalary/taxAgent/getForm', 'get', params);
}
export const getTaxAgentForm = (params) => {
return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/getForm", "get", params);
};
//获取个税扣缴义务人基础信息表单
export const getTaxAgentBaseForm = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/taxAgent/base/getForm",
"get",
params
);
};
//新建个税扣缴义务人
export const saveTaxAgent = params => {
return formPost('/api/bs/hrmsalary/taxAgent/save', params)
// return WeaTools.callApi('/api/bs/hrmsalary/taxAgent/save', 'POST', params);
}
export const saveTaxAgent = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/save", params);
};
//编辑个税扣缴义务人
export const updateTaxAgent = params => {
return formPost('/api/bs/hrmsalary/taxAgent/update', params)
}
export const updateTaxAgent = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/update", params);
};
//保存个税扣缴义务人基础信息
export const taxAgentBaseSave = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/base/save", params);
};
//删除个税扣缴义务人
export const deleteTaxAgent = params => {
return fetch('/api/bs/hrmsalary/taxAgent/delete', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const deleteTaxAgent = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/delete", params);
};
//人员范围保存
export const taxAgentRangeSave = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/range/save", params);
};
//人员范围删除
export const taxAgentRangeDelete = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/range/delete", params);
};
//人员范围列表
export const getTaxAgentRangeListInclude = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/range/listInclude", params);
};
//人员范围排除列表
export const getTaxAgentRangeListExclude = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/range/listExclude", params);
};
//获取人员范围表单
export const getTaxAgentRangeForm = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/range/getForm", params);
};
//个税扣缴义务人下拉列表
export const getTaxAgentSelectList = params => {
return WeaTools.callApi('/api/bs/hrmsalary/taxAgent/selectList', 'GET', params);
}
export const getTaxAgentSelectList = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/taxAgent/selectList",
"GET",
params
);
};

View File

@ -1,153 +1,217 @@
import React from 'react';
import { Row, Col, Table, DatePicker } from "antd"
import { inject, observer } from 'mobx-react';
import { WeaInput, WeaTextarea, WeaSearchGroup, WeaSelect } from "ecCom";
import { slideColumns} from './columns';
import "./editSlideContent.less"
import { WeaTableNew } from "comsMobx"
const WeaTable = WeaTableNew.WeaTable;
import moment from 'moment'
import React from "react";
import { Row, Col, Table, DatePicker } from "antd";
import { inject, observer } from "mobx-react";
import {
WeaInput,
WeaTextarea,
WeaSearchGroup,
WeaSelect,
WeaTable,
} from "ecCom";
import "./editSlideContent.less";
import moment from "moment";
const { MonthPicker } = DatePicker;
let emptyItem = {
incomeLowerLimit: "0.00",
incomeUpperLimit: "0.00",
dutyFreeValue: "0.00",
dutyFreeRate: "0.00",
taxableIncomeLl: "0.00",
taxableIncomeUl: "0.00",
taxRate: "0.00",
taxDeduction: "0.00"
}
incomeLowerLimit: "0.00",
incomeUpperLimit: "0.00",
dutyFreeValue: "0.00",
dutyFreeRate: "0.00",
taxableIncomeLl: "0.00",
taxableIncomeUl: "0.00",
taxRate: "0.00",
taxDeduction: "0.00",
};
@inject('cumDeductStore', "taxAgentStore")
@inject("cumDeductStore", "taxAgentStore")
@observer
export default class EditSlideContent extends React.Component {
constructor(props) {
super(props);
this.state = {
taxAgentId: "",
startDate: "",
endDate: "",
editable:
this.props.editable === undefined ? "true" : this.props.editable,
};
}
constructor(props) {
super(props);
this.state = {
taxAgentId: "",
startDate: "",
endDate: "",
editable: this.props.editable === undefined ? "true": this.props.editable
}
componentWillMount() {
// 初始化渲染页面
const {
taxAgentStore: { fetchTaxAgentOption },
} = this.props;
fetchTaxAgentOption();
}
addItem() {
const {
taxRateStore: { setDataSource },
} = this.props;
let dataSource = [...this.props.taxRateStore.dataSource];
let indexNum = 1;
if (dataSource.length > 0) {
indexNum = dataSource[dataSource.length - 1].indexNum + 1;
}
let item = { ...emptyItem };
item.indexNum = indexNum;
dataSource.push(item);
setDataSource(dataSource);
}
fetchCumDeductDetailList(param) {
const { cumDeductStore } = this.props;
const { getCumDeductDetailList, currentRecord } = cumDeductStore;
getCumDeductDetailList(currentRecord.id, param);
}
// 日期格式变化加载数据
handleFetchCumDeductDetailList(startDate, endDate, taxAgentId) {
let declareMonth = [];
if (startDate != "" && startDate != undefined) {
declareMonth.push(startDate);
}
componentWillMount() { // 初始化渲染页面
const { taxAgentStore: { fetchTaxAgentOption } } = this.props;
fetchTaxAgentOption();
if (endDate != "" && endDate != undefined) {
declareMonth.push(endDate);
}
addItem() {
const { taxRateStore: {setDataSource}} = this.props;
let dataSource = [...this.props.taxRateStore.dataSource];
let indexNum = 1;
if(dataSource.length > 0) {
indexNum = dataSource[dataSource.length - 1].indexNum + 1
}
let item = {...emptyItem}
item.indexNum = indexNum
dataSource.push(item);
setDataSource(dataSource)
let item = {
taxAgentId: taxAgentId,
};
if (declareMonth.length != 0) {
item.declareMonth = declareMonth;
}
this.fetchCumDeductDetailList(item);
}
fetchCumDeductDetailList(param) {
const { cumDeductStore} = this.props;
const { getCumDeductDetailList, currentRecord } = cumDeductStore;
getCumDeductDetailList(currentRecord.id, param);
}
onSelectChange = (val) => {
const { onChangeSlideSelectKey } = this.props;
onChangeSlideSelectKey && onChangeSlideSelectKey(val);
};
// 日期格式变化加载数据
handleFetchCumDeductDetailList(startDate, endDate, taxAgentId) {
let declareMonth = []
if(startDate != "" && startDate != undefined) {
declareMonth.push(startDate);
}
render() {
const {
taxAgentStore: { taxAgentOption },
} = this.props;
const { cumDeductStore } = this.props;
const {
slideTableStore,
currentRecord,
slideColumns,
slidePageObj,
slideTableDataSource,
setSlidePageObj,
slideLoading,
} = cumDeductStore;
const { startDate, endDate, taxAgentId } = this.state;
if(endDate != "" && endDate != undefined) {
declareMonth.push(endDate);
}
let item = {
taxAgentId: taxAgentId
}
if(declareMonth.length != 0) {
item.declareMonth = declareMonth
}
this.fetchCumDeductDetailList(item)
}
const pagination = {
total: slidePageObj.total,
showTotal: (total) => `${total}`,
showSizeChanger: true,
onShowSizeChange(current, pageSize) {
setSlidePageObj({ ...slidePageObj, current, pageSize });
},
onChange(current) {
setSlidePageObj({
...slidePageObj,
current,
pageSize: slidePageObj.pageSize,
});
},
};
const newColumns = _.map([...slideColumns], (item) => {
if (item.dataIndex === "declareMonth") {
return {
...item,
width: 120,
fixed: "left",
};
} else {
return { ...item };
}
});
const rowSelection = {
selectedRowKeys: this.props.slideSelectedKey,
onChange: this.onSelectChange,
};
return (
<div className="cumDeductSlide">
<Row className="topLabelBar">
<Col span={4}>
<span className="username">{currentRecord.username}</span>
</Col>
<Col span={12}>
<span className="formLabel">申报月份</span>
<div className="weaRangePickerWrapper">
<div className="monthPickerWrapper">
<MonthPicker
width={100}
value={startDate}
onChange={(v) => {
let startDate = "";
if (v != "" && v != undefined) {
startDate = moment(v).format("YYYY-MM");
}
this.setState({ startDate });
this.handleFetchCumDeductDetailList(
startDate,
endDate,
taxAgentId
);
}}
/>
</div>
<span className="betweenLable"></span>
<div className="monthPickerWrapper">
<MonthPicker
width={100}
value={endDate}
onChange={(v) => {
let endDate = "";
if (v != "" && v != undefined) {
endDate = moment(v).format("YYYY-MM");
}
this.setState({ endDate });
this.handleFetchCumDeductDetailList(
startDate,
endDate,
taxAgentId
);
}}
/>
</div>
</div>
</Col>
<Col span={8}>
<span className="formLabel">个税扣缴义务人</span>
<WeaSelect
showSearch // 设置select可搜索
style={{ width: 100 }}
options={taxAgentOption}
value={taxAgentId}
onChange={(v) => {
this.setState({ taxAgentId: v });
this.handleFetchCumDeductDetailList(startDate, endDate, v);
}}
/>
</Col>
</Row>
render() {
const { taxAgentStore: {taxAgentOption}} = this.props;
const { cumDeductStore } = this.props;
const { slideTableStore, currentRecord } = cumDeductStore;
const { startDate, endDate, taxAgentId } = this.state;
return (
<div className="cumDeductSlide">
<Row className="topLabelBar">
<Col span={4}>
<span className="username">{currentRecord.username}</span>
</Col>
<Col span={12}>
<span className="formLabel">申报月份</span>
<div className="weaRangePickerWrapper">
<div className="monthPickerWrapper">
<MonthPicker width={100} value={startDate}
onChange={(v) => {
let startDate = "";
if(v != "" && v!= undefined) {
startDate = moment(v).format("YYYY-MM")
}
this.setState({startDate})
this.handleFetchCumDeductDetailList(startDate, endDate, taxAgentId)
}}
/>
</div>
<span className="betweenLable">
</span>
<div className="monthPickerWrapper">
<MonthPicker width={100}
value={endDate}
onChange={(v) => {
let endDate = ""
if(v != "" && v!= undefined) {
endDate = moment(v).format("YYYY-MM")
}
this.setState({endDate})
this.handleFetchCumDeductDetailList(startDate, endDate, taxAgentId)
}}
/>
</div>
</div>
</Col>
<Col span={8}>
<span className="formLabel">个税扣缴义务人</span>
<WeaSelect
showSearch // 设置select可搜索
style={{ width: 100 }}
options={taxAgentOption}
value={taxAgentId}
onChange={v => {
this.setState({taxAgentId: v})
this.handleFetchCumDeductDetailList(startDate, endDate, v)
}}
/>
</Col>
</Row>
<div>
<WeaTable // table内部做了loading加载处理页面就不需要再加了
comsWeaTableStore={slideTableStore} // table store
hasOrder={true} // 是否启用排序
needScroll={true} // 是否启用table内部列表滚动将自适应到父级高度
scroll={{x: slideTableStore.columns.length * 100}}
/>
</div>
</div>
)
}
}
<div>
<WeaTable
rowKey="id"
rowSelection={rowSelection}
columns={newColumns}
dataSource={slideTableDataSource}
pagination={pagination}
loading={slideLoading}
scroll={{ x: 900 }}
/>
</div>
</div>
);
}
}

View File

@ -1,63 +1,73 @@
import React from 'react';
import { inject, observer } from 'mobx-react';
import { toJS } from 'mobx';
import { Button, Table, DatePicker, Dropdown, Menu, Modal, message, Row, Col } from 'antd';
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaDatePicker, WeaSelect, WeaHelpfulTip, WeaSlideModal } from 'ecCom';
import { WeaTableNew } from "comsMobx"
import moment from 'moment';
const WeaTable = WeaTableNew.WeaTable;
import { renderNoright, getSearchs } from '../../../util'; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import CustomTab from '../../../components/customTab';
import ContentWrapper from '../../../components/contentWrapper';
import ImportModal from '../../../components/importModal'
import { columns, dataSource, modalColumns } from './columns';
import React from "react";
import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
import { Button, DatePicker, Dropdown, Menu, message, Row, Col } from "antd";
import {
WeaTop,
WeaTab,
WeaRightMenu,
WeaDatePicker,
WeaSelect,
WeaHelpfulTip,
WeaSlideModal,
WeaTable,
} from "ecCom";
import moment from "moment";
import { renderNoright, getSearchs } from "../../../util"; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import CustomTab from "../../../components/customTab";
import ContentWrapper from "../../../components/contentWrapper";
import ImportModal from "../../../components/importModal";
import { modalColumns } from "./columns";
const { MonthPicker } = DatePicker;
import "./index.less"
import "./index.less";
import SlideModalTitle from '../../../components/slideModalTitle';
import EditSlideContent from './editSlideContent';
import SlideModalTitle from "../../../components/slideModalTitle";
import EditSlideContent from "./editSlideContent";
@inject('cumDeductStore', "taxAgentStore")
@inject("cumDeductStore", "taxAgentStore")
@observer
export default class CumDeduct extends React.Component {
constructor(props) {
super(props);
this.state = {
value: "",
selectedKey: "0",
selectedKey: [],
slideSelectedKey: [], //详情表格的选中项
visiable: false,
monthValue: moment(new Date()).format("YYYY-MM"),
monthValue: "",
taxAgentId: "",
datetime: "",
inited: false,
modalParam: {
declareMonth: "",
taxAgentId: ""
}
}
taxAgentId: "",
},
};
}
componentWillMount() { // 初始化渲染页面
const { cumDeductStore: { doInit }, taxAgentStore: { fetchTaxAgentOption } } = this.props;
componentWillMount() {
// 初始化渲染页面
const {
cumDeductStore: { doInit },
taxAgentStore: { fetchTaxAgentOption },
} = this.props;
doInit();
fetchTaxAgentOption().then(() => {
fetchTaxAgentOption().then((res) => {
this.setState({
inited: true
})
})
inited: true,
});
});
}
getSearchsAdQuick() {
const { monthValue, taxAgentId } = this.state;
const { taxAgentStore: { taxAgentOption }, cumDeductStore: {form, getTableDatas} } = this.props;
const {
taxAgentStore: { taxAgentOption },
cumDeductStore: { form, getTableDatas },
} = this.props;
return (
<div className="searchConditionWrapper">
<div className="searchConditionItem">
@ -66,9 +76,9 @@ export default class CumDeduct extends React.Component {
value={monthValue}
format="YYYY-MM"
width={200}
onChange={v => {
this.setState({monthValue: v})
getTableDatas({declareMonth: [v], taxAgentId})
onChange={(v) => {
this.setState({ monthValue: v });
getTableDatas({ declareMonth: v && [v], taxAgentId });
}}
/>
</div>
@ -83,206 +93,364 @@ export default class CumDeduct extends React.Component {
<div className="searchConditionItem">
<span className="conditionFormLabel">个税扣缴义务人:</span>
{
this.state.inited && <WeaSelect
{this.state.inited && (
<WeaSelect
showSearch // 设置select可搜索
style={{ width: 200 }}
options={taxAgentOption}
value={taxAgentId}
onChange={v => {
this.setState({taxAgentId: v})
getTableDatas({taxAgentId: v, declareMonth: [monthValue]})
onChange={(v) => {
this.setState({ taxAgentId: v });
getTableDatas({
taxAgentId: v,
declareMonth: monthValue && [monthValue],
});
}}
/>
}
)}
</div>
</div>
)
);
}
renderFormComponent() {
const { modalParam } = this.state
const { taxAgentStore: {taxAgentOption} } = this.props;
const { modalParam } = this.state;
const {
taxAgentStore: { taxAgentOption },
} = this.props;
return (
<Row>
<Col span={12}>
<span className="formLabel" style={{ lineHeight: "30px", marginRight: "10px" }}>税款所属期</span>
<WeaDatePicker
format="yyyy-MM"
value={modalParam.declareMonth}
onChange={value => this.setState({ modalParam: {...modalParam, declareMonth: value} })}
/>
</Col>
<Col span={12}>
<span className="formLabel" style={{ lineHeight: "30px", marginRight: "10px" }}>个税扣缴义务人</span>
<WeaSelect
showSearch // 设置select可搜索
style={{ width: 200, display: "inline-block" }}
options={taxAgentOption}
value={modalParam.taxAgentId}
onChange={v => {
this.setState({ modalParam: {...modalParam, taxAgentId: v} });
}}
/>
</Col>
</Row>
)
}
<Row>
<Col span={12}>
<span
className="formLabel"
style={{ lineHeight: "30px", marginRight: "10px" }}>
税款所属期
</span>
<WeaDatePicker
format="yyyy-MM"
value={modalParam.declareMonth}
onChange={(value) =>
this.setState({
modalParam: { ...modalParam, declareMonth: value },
})
}
/>
</Col>
<Col span={12}>
<span
className="formLabel"
style={{ lineHeight: "30px", marginRight: "10px" }}>
个税扣缴义务人
</span>
<WeaSelect
showSearch // 设置select可搜索
style={{ width: 200, display: "inline-block" }}
options={taxAgentOption}
value={modalParam.taxAgentId}
onChange={(v) => {
this.setState({ modalParam: { ...modalParam, taxAgentId: v } });
}}
/>
</Col>
</Row>
);
}
onEdit = (record) => {
const { cumDeductStore: { slideVisiable, setSlideVisiable, getCumDeductDetailList, setCurrentRecord } } = this.props;
setSlideVisiable(true)
setCurrentRecord(record)
const {
cumDeductStore: {
slideVisiable,
setSlideVisiable,
getCumDeductDetailList,
setCurrentRecord,
},
} = this.props;
setSlideVisiable(true);
setCurrentRecord(record);
getCumDeductDetailList(record.id);
}
};
// 增加编辑功能重写columns绑定事件
getColumns = (columns) => {
let newColumns = '';
newColumns = columns.map(column => {
let newColumns = "";
newColumns = columns.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 <a onClick={() => {this.onEdit(record)}}
>{text}</a>
return (
<a
onClick={() => {
this.onEdit(record);
}}>
{text}
</a>
);
case "operate":
return <a onClick={() => {this.onEdit(record)}}>查看明细</a>
return (
<a
onClick={() => {
this.onEdit(record);
}}>
查看明细
</a>
);
default:
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />;
}
}
};
return newColumn;
});
console.log("newColumns:", newColumns)
console.log("newColumns:", newColumns);
return newColumns;
}
};
handleCancel() {
const { cumDeductStore } = this.props;
const { modalVisiable, setModalVisiable, setStep } = cumDeductStore
const { modalVisiable, setModalVisiable, setStep } = cumDeductStore;
setModalVisiable(false);
setStep(0);
}
onOperatesClick = (record, index, operate, flag) => {
switch(operate.index.toString()){
case '0': // 查看明细
switch (operate.index.toString()) {
case "0": // 查看明细
this.onEdit(record);
break;
}
};
showColumn = () => {
const { cumDeductStore: { tableStore } } = this.props;
const {
cumDeductStore: { tableStore },
} = this.props;
tableStore.setColSetVisible(true);
tableStore.tableColSet(true);
}
};
// 初始化导入参数
handleInitModal() {
const { cumDeductStore: { setSlideDataSource, setImportResult }} = this.props;
setSlideDataSource([])
setImportResult({})
const {
cumDeductStore: { setSlideDataSource, setImportResult },
} = this.props;
setSlideDataSource([]);
setImportResult({});
}
onSelectChange = (val) => {
this.setState({
selectedKey: val,
});
};
render() {
const { modalParam } = this.state;
const { modalParam, slideSelectedKey, monthValue, taxAgentId } = this.state;
const { cumDeductStore, taxAgentStore } = this.props;
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd, previewImport, importFile } = cumDeductStore;
const { taxAgentOption } = taxAgentStore
const { slideVisiable, setSlideVisiable, modalVisiable, setModalVisiable, slideTableStore, step, setStep, slideDataSource, importResult } = cumDeductStore
const selectedRowKeys = toJS(tableStore.selectedRowKeys) || [];
const {
loading,
dataSource,
columns,
pageObj,
hasRight,
form,
condition,
tableStore,
showSearchAd,
getTableDatas,
doSearch,
setShowSearchAd,
previewImport,
importFile,
} = cumDeductStore;
const { taxAgentOption } = taxAgentStore;
const {
slideVisiable,
setSlideVisiable,
modalVisiable,
setModalVisiable,
slideTableStore,
step,
setStep,
slideDataSource,
importResult,
setPageObj,
} = cumDeductStore;
const selectedRowKeys = toJS(tableStore.selectedRowKeys) || [];
const detailSelectedRowKeys = toJS(slideTableStore.selectedRowKeys) || [];
if (!hasRight && !loading) { // 无权限处理
if (!hasRight && !loading) {
// 无权限处理
return renderNoright();
}
const rightMenu = [// 右键菜单
{
key: 'BTN_COLUMN',
icon: <i className='icon-coms-Custom' />,
content: '显示列定制',
onClick: this.showColumn
},
const rightMenu = [
// 右键菜单
// {
// key: "BTN_COLUMN",
// icon: <i className="icon-coms-Custom" />,
// content: "显示列定制",
// onClick: this.showColumn,
// },
];
const adBtn = [ // 高级搜索内部按钮
<Button type="primary" onClick={doSearch}>搜索</Button>,
<Button type="ghost" onClick={() => form.resetForm()}>重置</Button>,
<Button type="ghost" onClick={() => setShowSearchAd(false)}>取消</Button>,
const adBtn = [
// 高级搜索内部按钮
<Button type="primary" onClick={doSearch}>
搜索
</Button>,
<Button type="ghost" onClick={() => form.resetForm()}>
重置
</Button>,
<Button type="ghost" onClick={() => setShowSearchAd(false)}>
取消
</Button>,
];
const topTab = [
];
const topTab = [];
const renderSearchOperationItem = () => {
return <div></div>
}
return <div></div>;
};
const handleButtonClick = () => {
const { cumDeductStore: {exportCumDeductList}} = this.props;
const {
cumDeductStore: { exportCumDeductList },
} = this.props;
exportCumDeductList();
}
};
const handleMenuClick = () => {
if(selectedRowKeys.length == 0) {
message.warning("未选择条目")
return
if (this.state.selectedKey.length == 0) {
message.warning("未选择条目");
return;
}
const { cumDeductStore: { exportCumDeductList } } = this.props;
exportCumDeductList(selectedRowKeys.join(","))
}
const {
cumDeductStore: { exportCumDeductList },
} = this.props;
exportCumDeductList(this.state.selectedKey.join(","));
};
const handleBtnImport = () => {
const { cumDeductStore: { setModalVisiable, setStep } } = this.props;
const {
cumDeductStore: { setModalVisiable, setStep },
} = this.props;
setStep(0);
setModalVisiable(true)
}
setModalVisiable(true);
};
const btns = [
<Button type="primary" onClick={() => { handleBtnImport() }}>导入</Button>,
<Dropdown.Button onClick={handleButtonClick} overlay={
<Menu onClick={handleMenuClick}>
<Menu.Item key="1">导出选中</Menu.Item>
</Menu>
} type="ghost">
<Button
type="primary"
onClick={() => {
handleBtnImport();
}}>
导入
</Button>,
<Dropdown.Button
onClick={handleButtonClick}
overlay={
<Menu onClick={handleMenuClick}>
<Menu.Item key="1">导出选中</Menu.Item>
</Menu>
}
type="ghost">
导出全部
</Dropdown.Button>
]
</Dropdown.Button>,
];
const handleExportAllDetailClick = () => {
const {cumDeductStore: {exportCumDeductDetailList, currentRecord} } =this.props;
const {
cumDeductStore: { exportCumDeductDetailList, currentRecord },
} = this.props;
exportCumDeductDetailList(currentRecord.id);
}
};
const handleExportSelectedDetailClick = () => {
if(detailSelectedRowKeys.length == 0) {
message.warning("未选择条目")
return
if (this.state.slideSelectedKey.length == 0) {
message.warning("未选择条目");
return;
}
const { cumDeductStore: { exportCumDeductDetailList, currentRecord } } = this.props;
exportCumDeductDetailList(currentRecord.id, detailSelectedRowKeys.join(","))
}
const {
cumDeductStore: { exportCumDeductDetailList, currentRecord },
} = this.props;
exportCumDeductDetailList(
currentRecord.id,
this.state.slideSelectedKey.join(",")
);
};
const renderBtns = () => {
return (
<Dropdown.Button onClick={handleExportAllDetailClick} overlay={
<Menu onClick={handleExportSelectedDetailClick}>
<Menu.Item key="1">导出选中</Menu.Item>
</Menu>
} type="ghost">
<Dropdown.Button
onClick={handleExportAllDetailClick}
overlay={
<Menu onClick={handleExportSelectedDetailClick}>
<Menu.Item key="1">导出选中</Menu.Item>
</Menu>
}
type="ghost">
导出全部
</Dropdown.Button>
)
}
</Dropdown.Button>
);
};
const pagination = {
total: pageObj.total,
showTotal: (total) => `${total}`,
showSizeChanger: true,
onShowSizeChange(current, pageSize) {
setPageObj({ ...pageObj, current, pageSize });
},
onChange(current) {
setPageObj({ ...pageObj, current, pageSize: pageObj.pageSize });
},
};
const rowSelection = {
selectedRowKeys: this.state.selectedKey,
onChange: this.onSelectChange,
};
const newColumns = _.map([...columns], (item) => {
if (item.dataIndex === "username") {
return {
...item,
width: 100,
fixed: "left",
render: (text, record) => (
<div className="linkWapper">
<a href="javaScript:void(0);" onClick={() => this.onEdit(record)}>
{text}
</a>
</div>
),
};
} else if (item.dataIndex === "taxAgentName") {
return {
...item,
width: 180,
fixed: "left",
};
} else if (item.dataIndex === "operate") {
return {
...item,
width: 100,
fixed: "right",
render: (text, record) => (
<div className="linkWapper">
<a href="javaScript:void(0);" onClick={() => this.onEdit(record)}>
查看明细
</a>
</div>
),
};
} else {
return { ...item };
}
});
return (
<div className="cumDeductWrapper">
@ -291,39 +459,44 @@ export default class CumDeduct extends React.Component {
>
<WeaTop
title="累计专项附加扣除" // 文字
icon={<i className='icon-coms-meeting' />} // 左侧图标
iconBgcolor='#F14A2D' // 左侧图标背景色
icon={<i className="icon-coms-meeting" />} // 左侧图标
iconBgcolor="#F14A2D" // 左侧图标背景色
showDropIcon={true} // 是否显示下拉按钮
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
buttons={btns}
>
buttons={btns}>
<div className="weaTabWrapper">
<WeaTab
searchType={['base', 'advanced']} // base基础搜索框 advanced显示高级搜索按钮
searchType={["base", "advanced"]} // base基础搜索框 advanced显示高级搜索按钮
showSearchAd={showSearchAd} // 是否展开高级搜索面板
setShowSearchAd={bool => setShowSearchAd(bool)} //高级搜索面板受控
setShowSearchAd={(bool) => setShowSearchAd(bool)} //高级搜索面板受控
searchsAd={getSearchs(form, toJS(condition), 2)} // 高级搜索内部数据
buttonsAd={adBtn} // 高级搜索内部按钮
onSearch={getTableDatas} // 点搜索按钮时的回调
onSearch={() =>
getTableDatas({
taxAgentId,
declareMonth: monthValue && [monthValue],
})
} // 点搜索按钮时的回调
searchsAdQuick={this.getSearchsAdQuick()}
onSearchChange={v => form.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
onSearchChange={(v) => form.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
searchsBaseValue={form.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步
/>
</div>
<WeaTable // table内部做了loading加载处理页面就不需要再加了
comsWeaTableStore={tableStore} // table store
hasOrder={true} // 是否启用排序
needScroll={true} // 是否启用table内部列表滚动将自适应到父级高度
getColumns={this.getColumns}
onOperatesClick={this.onOperatesClick.bind(this)}
<WeaTable
rowKey="id"
rowSelection={rowSelection}
columns={newColumns}
dataSource={dataSource}
pagination={pagination}
loading={loading}
scroll={{ x: 1300 }}
/>
</WeaTop>
</WeaRightMenu>
{
modalVisiable && <ImportModal
{modalVisiable && (
<ImportModal
init={() => {
this.handleInitModal()
this.handleInitModal();
}}
params={modalParam}
columns={modalColumns}
@ -331,40 +504,59 @@ export default class CumDeduct extends React.Component {
setStep={setStep}
slideDataSource={slideDataSource}
importResult={importResult}
onFinish={() => {setModalVisiable(false); setStep(0); doSearch();}}
previewImport={(params) => {previewImport(params)}}
importFile={(params) => {importFile(params)}}
onFinish={() => {
setModalVisiable(false);
setStep(0);
doSearch();
}}
previewImport={(params) => {
previewImport(params);
}}
importFile={(params) => {
importFile(params);
}}
templateLink={"/api/bs/hrmsalary/addUpDeduction/downloadTemplate"}
renderFormComponent={() => this.renderFormComponent()}
visiable={modalVisiable}
onCancel={() => { this.handleCancel() }}
/>
}
{
slideVisiable && <WeaSlideModal visible={slideVisiable}
top={0}
width={60}
height={100}
direction={'right'}
measure={'%'}
title={
<SlideModalTitle
subtitle={"累计专项附加扣除记录"}
subTabs={[{title: "基础设置"}]}
onSave={() => {this.state.currentOperate == "add" ? doSave() : doUpdate()}}
editable={false}
btns={
renderBtns()
}
/>
}
content={(<EditSlideContent />)}
onClose={() => setSlideVisiable(false)}
showMask={true}
closeMaskOnClick={() => setSlideVisiable(false)} />
}
renderFormComponent={() => this.renderFormComponent()}
visiable={modalVisiable}
onCancel={() => {
this.handleCancel();
}}
/>
)}
{slideVisiable && (
<WeaSlideModal
visible={slideVisiable}
top={0}
width={60}
height={100}
direction={"right"}
measure={"%"}
title={
<SlideModalTitle
subtitle={"累计专项附加扣除记录"}
subTabs={[{ title: "基础设置" }]}
onSave={() => {
this.state.currentOperate == "add" ? doSave() : doUpdate();
}}
editable={false}
btns={renderBtns()}
/>
}
content={
<EditSlideContent
slideSelectedKey={slideSelectedKey}
onChangeSlideSelectKey={(val) =>
this.setState({ slideSelectedKey: val })
}
/>
}
onClose={() => setSlideVisiable(false)}
showMask={true}
closeMaskOnClick={() => setSlideVisiable(false)}
/>
)}
</div>
)
);
}
}

View File

@ -1,31 +1,47 @@
.cumDeductWrapper {
.weaTabWrapper {
position: relative;
.searchConditionWrapper {
width: 600px;
margin-left: 10px;
margin-top: 8px;
}
.searchConditionItem {
float: left;
}
.conditionFormLabel {
margin-right: 10px;
}
.helperWrapper {
float: left;
margin-left: 10px;
margin-right: 10px;
margin-top: 6px;
}
.weaTabWrapper {
position: relative;
.searchConditionWrapper {
width: 600px;
margin-left: 10px;
margin-top: 8px;
}
.wea-tab-search-ad-quick {
.wea-tab-right-search-ad-quick {
margin-top: 0px;
}
.wea-search-container-search-ad-quick {
top: 46px;
}
.searchConditionItem {
float: left;
}
.conditionFormLabel {
margin-right: 10px;
}
.helperWrapper {
float: left;
margin-left: 10px;
margin-right: 10px;
margin-top: 6px;
}
}
.wea-tab-search-ad-quick {
.wea-tab-right-search-ad-quick {
margin-top: 0px;
}
.wea-search-container-search-ad-quick {
top: 46px;
}
}
.linkWapper {
a {
color: #4d7ad8;
}
a:hover {
text-decoration: none;
}
}
}

View File

@ -1,156 +1,222 @@
import React from 'react';
import { Row, Col, Table, DatePicker } from "antd"
import { inject, observer } from 'mobx-react';
import { WeaInput, WeaTextarea, WeaSearchGroup, WeaSelect } from "ecCom";
import { slideColumns} from './columns';
import "./editSlideContent.less"
import { WeaTableNew } from "comsMobx"
const WeaTable = WeaTableNew.WeaTable;
import moment from 'moment'
import React from "react";
import { Row, Col, Table, DatePicker } from "antd";
import { inject, observer } from "mobx-react";
import {
WeaInput,
WeaTextarea,
WeaSearchGroup,
WeaSelect,
WeaTable,
} from "ecCom";
import { slideColumns } from "./columns";
import "./editSlideContent.less";
import moment from "moment";
const { MonthPicker } = DatePicker;
let emptyItem = {
incomeLowerLimit: "0.00",
incomeUpperLimit: "0.00",
dutyFreeValue: "0.00",
dutyFreeRate: "0.00",
taxableIncomeLl: "0.00",
taxableIncomeUl: "0.00",
taxRate: "0.00",
taxDeduction: "0.00"
}
incomeLowerLimit: "0.00",
incomeUpperLimit: "0.00",
dutyFreeValue: "0.00",
dutyFreeRate: "0.00",
taxableIncomeLl: "0.00",
taxableIncomeUl: "0.00",
taxRate: "0.00",
taxDeduction: "0.00",
};
@inject('cumSituationStore', "taxAgentStore")
@inject("cumSituationStore", "taxAgentStore")
@observer
export default class EditSlideContent extends React.Component {
constructor(props) {
super(props);
this.state = {
taxAgentId: "",
startDate: "",
endDate: "",
editable: this.props.editable === undefined ? "true": this.props.editable
}
constructor(props) {
super(props);
this.state = {
taxAgentId: "",
startDate: "",
endDate: "",
editable:
this.props.editable === undefined ? "true" : this.props.editable,
};
}
componentWillMount() {
// 初始化渲染页面
const {
taxAgentStore: { fetchTaxAgentOption },
} = this.props;
fetchTaxAgentOption();
}
addItem() {
const {
taxRateStore: { setDataSource },
} = this.props;
let dataSource = [...this.props.taxRateStore.dataSource];
let indexNum = 1;
if (dataSource.length > 0) {
indexNum = dataSource[dataSource.length - 1].indexNum + 1;
}
let item = { ...emptyItem };
item.indexNum = indexNum;
dataSource.push(item);
setDataSource(dataSource);
}
fetchCumDeductDetailList(param) {
const { cumSituationStore } = this.props;
const { getCumDeductDetailList, currentRecord } = cumSituationStore;
getCumDeductDetailList(currentRecord.id, param);
}
// 日期格式变化加载数据
handleFetchCumDeductDetailList(startDate, endDate, taxAgentId) {
let declareMonth = [];
if (startDate != "" && startDate != undefined) {
declareMonth.push(startDate);
}
componentWillMount() { // 初始化渲染页面
const { taxAgentStore: { fetchTaxAgentOption } } = this.props;
fetchTaxAgentOption();
if (endDate != "" && endDate != undefined) {
declareMonth.push(endDate);
}
addItem() {
const { taxRateStore: {setDataSource}} = this.props;
let dataSource = [...this.props.taxRateStore.dataSource];
let indexNum = 1;
if(dataSource.length > 0) {
indexNum = dataSource[dataSource.length - 1].indexNum + 1
}
let item = {...emptyItem}
item.indexNum = indexNum
dataSource.push(item);
setDataSource(dataSource)
let item = {
taxAgentId: taxAgentId,
};
if (declareMonth.length != 0) {
item.taxYearMonth = declareMonth;
}
this.fetchCumDeductDetailList(item);
}
fetchCumDeductDetailList(param) {
const { cumSituationStore} = this.props;
const { getCumDeductDetailList, currentRecord } = cumSituationStore;
getCumDeductDetailList(currentRecord.id, param);
}
onSelectChange = (val) => {
const { onChangeSlideSelectKey } = this.props;
onChangeSlideSelectKey && onChangeSlideSelectKey(val);
};
render() {
const {
taxAgentStore: { taxAgentOption },
} = this.props;
const { cumSituationStore } = this.props;
const {
slideTableStore,
currentRecord,
slideColumns,
slidePageObj,
slideTableDataSource,
setSlidePageObj,
slideLoading,
} = cumSituationStore;
const { startDate, endDate, taxAgentId } = this.state;
// 日期格式变化加载数据
handleFetchCumDeductDetailList(startDate, endDate, taxAgentId) {
let declareMonth = []
if(startDate != "" && startDate != undefined) {
declareMonth.push(startDate);
}
const pagination = {
total: slidePageObj.total,
showTotal: (total) => `${total}`,
showSizeChanger: true,
onShowSizeChange(current, pageSize) {
setSlidePageObj({ ...slidePageObj, current, pageSize });
},
onChange(current) {
setSlidePageObj({
...slidePageObj,
current,
pageSize: slidePageObj.pageSize,
});
},
};
const newColumns = _.map([...slideColumns], (item) => {
if (item.dataIndex === "declareMonth") {
return {
...item,
width: 120,
fixed: "left",
};
} else {
return { ...item };
}
});
const rowSelection = {
selectedRowKeys: this.props.slideSelectedKey,
onChange: this.onSelectChange,
};
return (
<div className="cumDeductSlide">
<Row className="topLabelBar">
<Col span={4}>
<span className="username">{currentRecord.username}</span>
</Col>
<Col span={12}>
<span className="formLabel">申报月份</span>
<div className="weaRangePickerWrapper">
<div className="monthPickerWrapper">
<MonthPicker
width={100}
format="YYYY-MM"
value={startDate}
onChange={(v) => {
let startDate = "";
if (v != "" && v != undefined) {
startDate = moment(v).format("YYYY-MM");
}
this.setState({ startDate });
this.handleFetchCumDeductDetailList(
startDate,
endDate,
taxAgentId
);
}}
/>
</div>
<span className="betweenLable"></span>
<div className="monthPickerWrapper">
<MonthPicker
width={100}
value={endDate}
onChange={(v) => {
let endDate = "";
if (v != "" && v != undefined) {
endDate = moment(v).format("YYYY-MM");
}
this.setState({ endDate });
this.handleFetchCumDeductDetailList(
startDate,
endDate,
taxAgentId
);
}}
/>
</div>
</div>
</Col>
<Col span={8}>
<span className="formLabel">个税扣缴义务人</span>
<WeaSelect
showSearch // 设置select可搜索
style={{ width: 100 }}
options={taxAgentOption}
value={taxAgentId}
onChange={(v) => {
this.setState({ taxAgentId: v });
this.fetchCumDeductDetailList({
declareMonth: [startDate, endDate],
taxAgentId: v,
});
}}
/>
</Col>
</Row>
if(endDate != "" && endDate != undefined) {
declareMonth.push(endDate);
}
let item = {
taxAgentId: taxAgentId
}
if(declareMonth.length != 0) {
item.taxYearMonth = declareMonth
}
this.fetchCumDeductDetailList(item)
}
render() {
const { taxAgentStore: {taxAgentOption}} = this.props;
const { cumSituationStore } = this.props;
const { slideTableStore, currentRecord } = cumSituationStore;
const { startDate, endDate, taxAgentId } = this.state;
return (
<div className="cumDeductSlide">
<Row className="topLabelBar">
<Col span={4}>
<span className="username">{currentRecord.username}</span>
</Col>
<Col span={12}>
<span className="formLabel">申报月份</span>
<div className="weaRangePickerWrapper">
<div className="monthPickerWrapper">
<MonthPicker width={100} format="YYYY-MM" value={startDate}
onChange={(v) => {
let startDate = "";
if(v != "" && v!= undefined) {
startDate = moment(v).format("YYYY-MM")
}
this.setState({startDate})
this.handleFetchCumDeductDetailList(startDate, endDate, taxAgentId)
}}
/>
</div>
<span className="betweenLable">
</span>
<div className="monthPickerWrapper">
<MonthPicker width={100}
value={endDate}
onChange={(v) => {
let endDate = ""
if(v != "" && v!= undefined) {
endDate = moment(v).format("YYYY-MM")
}
this.setState({endDate})
this.handleFetchCumDeductDetailList(startDate, endDate, taxAgentId)
}}
/>
</div>
</div>
</Col>
<Col span={8}>
<span className="formLabel">个税扣缴义务人</span>
<WeaSelect
showSearch // 设置select可搜索
style={{ width: 100 }}
options={taxAgentOption}
value={taxAgentId}
onChange={v => {
this.setState({taxAgentId: v})
this.fetchCumDeductDetailList({
declareMonth: [startDate, endDate],
taxAgentId: v
})
}}
/>
</Col>
</Row>
<div>
<WeaTable // table内部做了loading加载处理页面就不需要再加了
comsWeaTableStore={slideTableStore} // table store
hasOrder={true} // 是否启用排序
needScroll={true} // 是否启用table内部列表滚动将自适应到父级高度
scroll={{x: slideTableStore.columns.length * 100}}
/>
</div>
</div>
)
}
}
<div>
<WeaTable
rowKey="id"
rowSelection={rowSelection}
columns={newColumns}
dataSource={slideTableDataSource}
pagination={pagination}
loading={slideLoading}
scroll={{ x: 900 }}
/>
</div>
</div>
);
}
}

View File

@ -1,61 +1,84 @@
import React from 'react';
import { inject, observer } from 'mobx-react';
import { toJS } from 'mobx';
import React from "react";
import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
import { Button, Table, DatePicker, Dropdown, Menu, Modal, message, Row, Col } from 'antd';
import {
Button,
Table,
DatePicker,
Dropdown,
Menu,
Modal,
message,
Row,
Col,
} from "antd";
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaDatePicker, WeaSelect, WeaHelpfulTip, WeaSlideModal } from 'ecCom';
import { WeaTableNew } from "comsMobx"
import moment from 'moment';
const WeaTable = WeaTableNew.WeaTable;
import { renderNoright, getSearchs } from '../../../util'; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import CustomTab from '../../../components/customTab';
import ContentWrapper from '../../../components/contentWrapper';
import ImportModal from '../../../components/importModal'
import { columns, dataSource, modalColumns } from './columns';
import {
WeaTop,
WeaTab,
WeaRightMenu,
WeaRangePicker,
WeaDatePicker,
WeaSelect,
WeaHelpfulTip,
WeaSlideModal,
WeaTable,
} from "ecCom";
import moment from "moment";
import { renderNoright, getSearchs } from "../../../util"; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import CustomTab from "../../../components/customTab";
import ContentWrapper from "../../../components/contentWrapper";
import ImportModal from "../../../components/importModal";
import { modalColumns } from "./columns";
const { MonthPicker } = DatePicker;
import "./index.less"
import "./index.less";
import SlideModalTitle from '../../../components/slideModalTitle';
import EditSlideContent from './editSlideContent';
import SlideModalTitle from "../../../components/slideModalTitle";
import EditSlideContent from "./editSlideContent";
@inject('cumSituationStore', "taxAgentStore")
@inject("cumSituationStore", "taxAgentStore")
@observer
export default class CumSituation extends React.Component {
constructor(props) {
super(props);
this.state = {
value: "",
selectedKey: "0",
selectedKey: [],
slideSelectedKey: [], //详情表格的选中项
visiable: false,
inited: false,
monthValue: moment(new Date()).format("YYYY-MM"),
monthValue: "",
taxAgentId: "",
modalParam: {
taxYearMonth: "",
}
}
},
};
}
componentWillMount() { // 初始化渲染页面
const { cumSituationStore: { doInit }, taxAgentStore: { fetchTaxAgentOption } } = this.props;
componentWillMount() {
// 初始化渲染页面
const {
cumSituationStore: { doInit },
taxAgentStore: { fetchTaxAgentOption },
} = this.props;
doInit();
fetchTaxAgentOption().then(() => {
this.setState({
inited: true
})
})
inited: true,
});
});
}
getSearchsAdQuick() {
const { monthValue, taxAgentId } = this.state;
const { taxAgentStore: { taxAgentOption }, cumSituationStore: {form, getTableDatas} } = this.props;
const {
taxAgentStore: { taxAgentOption },
cumSituationStore: { form, getTableDatas },
} = this.props;
return (
<div className="searchConditionWrapper">
<div className="searchConditionItem">
@ -64,9 +87,9 @@ export default class CumSituation extends React.Component {
value={monthValue}
format="YYYY-MM"
width={200}
onChange={v => {
this.setState({monthValue: v})
getTableDatas({ taxYearMonth: [v], taxAgentId })
onChange={(v) => {
this.setState({ monthValue: v });
getTableDatas({ taxYearMonth: v && [v], taxAgentId });
}}
/>
</div>
@ -81,203 +104,354 @@ export default class CumSituation extends React.Component {
<div className="searchConditionItem">
<span className="conditionFormLabel">个税扣缴义务人:</span>
{
this.state.inited && <WeaSelect
{this.state.inited && (
<WeaSelect
showSearch // 设置select可搜索
style={{ width: 200 }}
options={taxAgentOption}
value={taxAgentId}
onChange={v => {
this.setState({taxAgentId: v})
getTableDatas({ taxAgentId: v, taxYearMonth: [monthValue]})
onChange={(v) => {
this.setState({ taxAgentId: v });
getTableDatas({
taxAgentId: v,
taxYearMonth: monthValue && [monthValue],
});
}}
/>
}
)}
</div>
</div>
)
);
}
renderFormComponent() {
const { modalParam } = this.state
const { taxAgentStore: {taxAgentOption} } = this.props;
const { modalParam } = this.state;
const {
taxAgentStore: { taxAgentOption },
} = this.props;
return (
<Row>
<Col span={12}>
<span className="formLabel" style={{ lineHeight: "30px", marginRight: "10px" }}>税款所属期</span>
<WeaDatePicker
format="yyyy-MM"
value={modalParam.taxYearMonth}
onChange={value => this.setState({ modalParam: {taxYearMonth: value} })}
/>
</Col>
</Row>
)
<Row>
<Col span={12}>
<span
className="formLabel"
style={{ lineHeight: "30px", marginRight: "10px" }}>
税款所属期
</span>
<WeaDatePicker
format="yyyy-MM"
value={modalParam.taxYearMonth}
onChange={(value) =>
this.setState({ modalParam: { taxYearMonth: value } })
}
/>
</Col>
</Row>
);
}
onEdit = (record) => {
const { cumSituationStore: { slideVisiable, setSlideVisiable, getCumDeductDetailList, setCurrentRecord } } = this.props;
setSlideVisiable(true)
setCurrentRecord(record)
const {
cumSituationStore: {
slideVisiable,
setSlideVisiable,
getCumDeductDetailList,
setCurrentRecord,
},
} = this.props;
setSlideVisiable(true);
setCurrentRecord(record);
getCumDeductDetailList(record.id);
}
};
// 增加编辑功能重写columns绑定事件
getColumns = (columns) => {
let newColumns = [];
if(!columns) {
return []
if (!columns) {
return [];
}
newColumns = columns.map(column => {
newColumns = columns.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 <a onClick={() => {this.onEdit(record)}}
dangerouslySetInnerHTML={{ __html: valueSpan }} />
return (
<a
onClick={() => {
this.onEdit(record);
}}
dangerouslySetInnerHTML={{ __html: valueSpan }}
/>
);
case "operate":
return <a onClick={() => {this.onEdit(record)}}>查看明细</a>
return (
<a
onClick={() => {
this.onEdit(record);
}}>
查看明细
</a>
);
default:
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />;
}
}
};
return newColumn;
});
console.log("newColumns: ", newColumns);
return newColumns;
}
};
handleCancel() {
const { cumSituationStore } = this.props;
const { modalVisiable, setModalVisiable, setStep } = cumSituationStore
const { modalVisiable, setModalVisiable, setStep } = cumSituationStore;
setModalVisiable(false);
setStep(0);
}
onOperatesClick = (record, index, operate, flag) => {
switch(operate.index.toString()){
case '0': // 查看明细
switch (operate.index.toString()) {
case "0": // 查看明细
this.onEdit(record);
break;
}
};
showColumn = () => {
const { cumSituationStore: { tableStore } } = this.props;
const {
cumSituationStore: { tableStore },
} = this.props;
tableStore.setColSetVisible(true);
tableStore.tableColSet(true);
}
};
// 导入参数初始化
handleInitImport = () => {
const { cumSituationStore: { setSlideDataSource, setImportResult } } = this.props;
setSlideDataSource([])
setImportResult({})
}
const {
cumSituationStore: { setSlideDataSource, setImportResult },
} = this.props;
setSlideDataSource([]);
setImportResult({});
};
onSelectChange = (val) => {
this.setState({
selectedKey: val,
});
};
render() {
const { cumSituationStore, taxAgentStore } = this.props;
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd, previewImport, importFile } = cumSituationStore;
const { taxAgentOption } = taxAgentStore
const { slideVisiable, setSlideVisiable, modalVisiable, setModalVisiable, slideTableStore, step, setStep, slideDataSource, importResult } = cumSituationStore
const selectedRowKeys = toJS(tableStore.selectedRowKeys) || [];
const { modalParam } = this.state;
const { cumSituationStore, taxAgentStore, slideSelectedKey } = this.props;
const {
loading,
dataSource,
columns,
pageObj,
hasRight,
form,
condition,
tableStore,
showSearchAd,
getTableDatas,
doSearch,
setShowSearchAd,
previewImport,
importFile,
} = cumSituationStore;
const { taxAgentOption } = taxAgentStore;
const {
slideVisiable,
setSlideVisiable,
modalVisiable,
setModalVisiable,
slideTableStore,
step,
setStep,
slideDataSource,
importResult,
setPageObj,
} = cumSituationStore;
const selectedRowKeys = toJS(tableStore.selectedRowKeys) || [];
const { modalParam, monthValue, taxAgentId } = this.state;
const detailSelectedRowKeys = toJS(slideTableStore.selectedRowKeys) || [];
if (!hasRight && !loading) { // 无权限处理
if (!hasRight && !loading) {
// 无权限处理
return renderNoright();
}
const rightMenu = [// 右键菜单
{
key: 'BTN_COLUMN',
icon: <i className='icon-coms-Custom' />,
content: '显示列定制',
onClick: this.showColumn
},
const rightMenu = [
// 右键菜单
// {
// key: "BTN_COLUMN",
// icon: <i className="icon-coms-Custom" />,
// content: "显示列定制",
// onClick: this.showColumn,
// },
];
const collectParams = { // 收藏功能配置
favname: '往期累计情况(工资、薪金)',
const collectParams = {
// 收藏功能配置
favname: "往期累计情况(工资、薪金)",
favouritetype: 1,
objid: 0,
link: 'wui/index.html#/ns_demo03/index',
link: "wui/index.html#/ns_demo03/index",
importantlevel: 1,
};
const adBtn = [ // 高级搜索内部按钮
<Button type="primary" onClick={doSearch}>搜索</Button>,
<Button type="ghost" onClick={() => form.resetForm()}>重置</Button>,
<Button type="ghost" onClick={() => setShowSearchAd(false)}>取消</Button>,
const adBtn = [
// 高级搜索内部按钮
<Button type="primary" onClick={doSearch}>
搜索
</Button>,
<Button type="ghost" onClick={() => form.resetForm()}>
重置
</Button>,
<Button type="ghost" onClick={() => setShowSearchAd(false)}>
取消
</Button>,
];
const topTab = [
];
const topTab = [];
const renderSearchOperationItem = () => {
return <div></div>
}
return <div></div>;
};
const handleButtonClick = () => {
const { cumSituationStore: {exportCumDeductList}} = this.props;
const {
cumSituationStore: { exportCumDeductList },
} = this.props;
exportCumDeductList();
}
};
const handleMenuClick = () => {
if(selectedRowKeys.length == 0) {
message.warning("未选择条目")
return
if (selectedRowKeys.length == 0) {
message.warning("未选择条目");
return;
}
const { cumSituationStore: { exportCumDeductList } } = this.props;
exportCumDeductList(selectedRowKeys.join(","))
}
const {
cumSituationStore: { exportCumDeductList },
} = this.props;
exportCumDeductList(selectedRowKeys.join(","));
};
const handleBtnImport = () => {
const { cumSituationStore: { setModalVisiable, setStep } } = this.props;
const {
cumSituationStore: { setModalVisiable, setStep },
} = this.props;
setStep(0);
setModalVisiable(true)
}
setModalVisiable(true);
};
const btns = [
<Button type="primary" onClick={() => { handleBtnImport() }}>导入</Button>,
<Dropdown.Button onClick={handleButtonClick} overlay={
<Menu onClick={handleMenuClick}>
<Menu.Item key="1">导出选中</Menu.Item>
</Menu>
} type="ghost">
<Button
type="primary"
onClick={() => {
handleBtnImport();
}}>
导入
</Button>,
<Dropdown.Button
onClick={handleButtonClick}
overlay={
<Menu onClick={handleMenuClick}>
<Menu.Item key="1">导出选中</Menu.Item>
</Menu>
}
type="ghost">
导出全部
</Dropdown.Button>
]
</Dropdown.Button>,
];
const handleExportAllDetailClick = () => {
const {cumSituationStore: {exportCumSituationDetailList, currentRecord} } =this.props;
const {
cumSituationStore: { exportCumSituationDetailList, currentRecord },
} = this.props;
exportCumSituationDetailList(currentRecord.id);
}
};
const handleExportSelectedDetailClick = () => {
if(detailSelectedRowKeys.length == 0) {
message.warning("未选择条目")
return
if (this.state.slideSelectedKey.length == 0) {
message.warning("未选择条目");
return;
}
const { cumSituationStore: { exportCumSituationDetailList, currentRecord } } = this.props;
exportCumSituationDetailList(currentRecord.id, detailSelectedRowKeys.join(","))
}
const {
cumSituationStore: { exportCumSituationDetailList, currentRecord },
} = this.props;
exportCumSituationDetailList(
currentRecord.id,
this.state.slideSelectedKey.join(",")
);
};
const renderBtns = () => {
return (
<Dropdown.Button onClick={handleExportAllDetailClick} overlay={
<Menu onClick={handleExportSelectedDetailClick}>
<Menu.Item key="1">导出选中</Menu.Item>
</Menu>
} type="ghost">
<Dropdown.Button
onClick={handleExportAllDetailClick}
overlay={
<Menu onClick={handleExportSelectedDetailClick}>
<Menu.Item key="1">导出选中</Menu.Item>
</Menu>
}
type="ghost">
导出全部
</Dropdown.Button>
)
}
</Dropdown.Button>
);
};
const pagination = {
total: pageObj.total,
showTotal: (total) => `${total}`,
showSizeChanger: true,
onShowSizeChange(current, pageSize) {
setPageObj({ ...pageObj, current, pageSize });
},
onChange(current) {
setPageObj({ ...pageObj, current, pageSize: pageObj.pageSize });
},
};
const rowSelection = {
selectedRowKeys: this.state.selectedKey,
onChange: this.onSelectChange,
};
const newColumns = _.map([...columns], (item) => {
if (item.dataIndex === "username") {
return {
...item,
width: 100,
fixed: "left",
render: (text, record) => (
<div className="linkWapper">
<a href="javaScript:void(0);" onClick={() => this.onEdit(record)}>
{text}
</a>
</div>
),
};
} else if (item.dataIndex === "taxAgentName") {
return {
...item,
width: 180,
fixed: "left",
};
} else if (item.dataIndex === "operate") {
return {
...item,
width: 100,
fixed: "right",
render: (text, record) => (
<div className="linkWapper">
<a href="javaScript:void(0);" onClick={() => this.onEdit(record)}>
查看明细
</a>
</div>
),
};
} else {
return { ...item, width: 150 };
}
});
return (
<div className="cumDeductWrapper">
@ -286,80 +460,104 @@ export default class CumSituation extends React.Component {
>
<WeaTop
title="往期累计情况(工资、薪金)" // 文字
icon={<i className='icon-coms-meeting' />} // 左侧图标
iconBgcolor='#F14A2D' // 左侧图标背景色
icon={<i className="icon-coms-meeting" />} // 左侧图标
iconBgcolor="#F14A2D" // 左侧图标背景色
showDropIcon={true} // 是否显示下拉按钮
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
buttons={btns}
>
buttons={btns}>
<div className="weaTabWrapper">
<WeaTab
searchType={['base', 'advanced']} // base基础搜索框 advanced显示高级搜索按钮
searchType={["base", "advanced"]} // base基础搜索框 advanced显示高级搜索按钮
showSearchAd={showSearchAd} // 是否展开高级搜索面板
setShowSearchAd={bool => setShowSearchAd(bool)} //高级搜索面板受控
setShowSearchAd={(bool) => setShowSearchAd(bool)} //高级搜索面板受控
searchsAd={getSearchs(form, toJS(condition), 2)} // 高级搜索内部数据
buttonsAd={adBtn} // 高级搜索内部按钮
onSearch={getTableDatas} // 点搜索按钮时的回调
onSearch={() =>
getTableDatas({
taxAgentId,
declareMonth: monthValue && [monthValue],
})
} // 点搜索按钮时的回调
searchsAdQuick={this.getSearchsAdQuick()}
onSearchChange={v => form.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
onSearchChange={(v) => form.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
searchsBaseValue={form.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步
/>
</div>
<WeaTable // table内部做了loading加载处理页面就不需要再加了
comsWeaTableStore={tableStore} // table store
hasOrder={true} // 是否启用排序
needScroll={true} // 是否启用table内部列表滚动将自适应到父级高度
getColumns={this.getColumns}
scroll={{x: this.getColumns(tableStore.columns).length * 100}}
onOperatesClick={this.onOperatesClick.bind(this)}
<WeaTable
rowKey="id"
rowSelection={rowSelection}
columns={newColumns}
dataSource={dataSource}
pagination={pagination}
loading={loading}
scroll={{ x: 1300 }}
/>
</WeaTop>
</WeaRightMenu>
{
modalVisiable && <ImportModal
{modalVisiable && (
<ImportModal
init={() => {
this.handleInitImport()
this.handleInitImport();
}}
templateLink={"/api/bs/hrmsalary/addUpSituation/downloadTemplate"}
params={modalParam}
columns={modalColumns}
step={step}
setStep={setStep}
onFinish={() => {setModalVisiable(false); setStep(0); doSearch();}}
onFinish={() => {
setModalVisiable(false);
setStep(0);
doSearch();
}}
slideDataSource={slideDataSource}
importResult={importResult}
previewImport={(params) => {previewImport(params)}}
importFile={(params) => {importFile(params)}}
renderFormComponent={() => this.renderFormComponent()}
visiable={modalVisiable}
onCancel={() => { this.handleCancel() }} />
}
{
slideVisiable && <WeaSlideModal visible={slideVisiable}
top={0}
width={60}
height={100}
direction={'right'}
measure={'%'}
title={
<SlideModalTitle
subtitle={"往期累计情况(工资、薪金)记录"}
subTabs={[{title: "基础设置"}]}
onSave={() => {this.state.currentOperate == "add" ? doSave() : doUpdate()}}
editable={false}
btns={
renderBtns()
}
/>
}
content={(<EditSlideContent />)}
onClose={() => setSlideVisiable(false)}
showMask={true}
closeMaskOnClick={() => setSlideVisiable(false)} />
}
previewImport={(params) => {
previewImport(params);
}}
importFile={(params) => {
importFile(params);
}}
renderFormComponent={() => this.renderFormComponent()}
visiable={modalVisiable}
onCancel={() => {
this.handleCancel();
}}
/>
)}
{slideVisiable && (
<WeaSlideModal
visible={slideVisiable}
top={0}
width={60}
height={100}
direction={"right"}
measure={"%"}
title={
<SlideModalTitle
subtitle={"往期累计情况(工资、薪金)记录"}
subTabs={[{ title: "基础设置" }]}
onSave={() => {
this.state.currentOperate == "add" ? doSave() : doUpdate();
}}
editable={false}
btns={renderBtns()}
/>
}
content={
<EditSlideContent
slideSelectedKey={slideSelectedKey}
onChangeSlideSelectKey={(val) =>
this.setState({ slideSelectedKey: val })
}
/>
}
onClose={() => setSlideVisiable(false)}
showMask={true}
closeMaskOnClick={() => setSlideVisiable(false)}
/>
)}
</div>
)
);
}
}

View File

@ -1,153 +1,218 @@
import React from 'react';
import { Row, Col, Table, DatePicker } from "antd"
import { inject, observer } from 'mobx-react';
import { WeaInput, WeaTextarea, WeaSearchGroup, WeaSelect } from "ecCom";
import { slideColumns} from './columns';
import "./editSlideContent.less"
import { WeaTableNew } from "comsMobx"
const WeaTable = WeaTableNew.WeaTable;
import moment from 'moment'
import React from "react";
import { Row, Col, Table, DatePicker } from "antd";
import { inject, observer } from "mobx-react";
import {
WeaInput,
WeaTextarea,
WeaSearchGroup,
WeaSelect,
WeaTable,
} from "ecCom";
import "./editSlideContent.less";
import moment from "moment";
const { MonthPicker } = DatePicker;
let emptyItem = {
incomeLowerLimit: "0.00",
incomeUpperLimit: "0.00",
dutyFreeValue: "0.00",
dutyFreeRate: "0.00",
taxableIncomeLl: "0.00",
taxableIncomeUl: "0.00",
taxRate: "0.00",
taxDeduction: "0.00"
}
incomeLowerLimit: "0.00",
incomeUpperLimit: "0.00",
dutyFreeValue: "0.00",
dutyFreeRate: "0.00",
taxableIncomeLl: "0.00",
taxableIncomeUl: "0.00",
taxRate: "0.00",
taxDeduction: "0.00",
};
@inject('otherDeductStore', "taxAgentStore")
@inject("otherDeductStore", "taxAgentStore")
@observer
export default class EditSlideContent extends React.Component {
constructor(props) {
super(props);
this.state = {
taxAgentId: "",
startDate: "",
endDate: "",
editable:
this.props.editable === undefined ? "true" : this.props.editable,
};
}
constructor(props) {
super(props);
this.state = {
taxAgentId: "",
startDate: "",
endDate: "",
editable: this.props.editable === undefined ? "true": this.props.editable
}
componentWillMount() {
// 初始化渲染页面
const {
taxAgentStore: { fetchTaxAgentOption },
} = this.props;
fetchTaxAgentOption();
}
addItem() {
const {
taxRateStore: { setDataSource },
} = this.props;
let dataSource = [...this.props.taxRateStore.dataSource];
let indexNum = 1;
if (dataSource.length > 0) {
indexNum = dataSource[dataSource.length - 1].indexNum + 1;
}
let item = { ...emptyItem };
item.indexNum = indexNum;
dataSource.push(item);
setDataSource(dataSource);
}
fetchCumDeductDetailList(param) {
const { otherDeductStore } = this.props;
const { getOtherDeductDetailList, currentRecord } = otherDeductStore;
getOtherDeductDetailList(currentRecord.id, param);
}
// 日期格式变化加载数据
handleFetchCumDeductDetailList(startDate, endDate, taxAgentId) {
let declareMonth = [];
if (startDate != "" && startDate != undefined) {
declareMonth.push(startDate);
}
componentWillMount() { // 初始化渲染页面
const { taxAgentStore: { fetchTaxAgentOption } } = this.props;
fetchTaxAgentOption();
if (endDate != "" && endDate != undefined) {
declareMonth.push(endDate);
}
addItem() {
const { taxRateStore: {setDataSource}} = this.props;
let dataSource = [...this.props.taxRateStore.dataSource];
let indexNum = 1;
if(dataSource.length > 0) {
indexNum = dataSource[dataSource.length - 1].indexNum + 1
}
let item = {...emptyItem}
item.indexNum = indexNum
dataSource.push(item);
setDataSource(dataSource)
let item = {
taxAgentId: taxAgentId,
};
if (declareMonth.length != 0) {
item.declareMonth = declareMonth;
}
this.fetchCumDeductDetailList(item);
}
fetchCumDeductDetailList(param) {
const { otherDeductStore} = this.props;
const { getOtherDeductDetailList, currentRecord } = otherDeductStore;
getOtherDeductDetailList(currentRecord.id, param);
}
onSelectChange = (val) => {
const { onChangeSlideSelectKey } = this.props;
onChangeSlideSelectKey && onChangeSlideSelectKey(val);
};
// 日期格式变化加载数据
handleFetchCumDeductDetailList(startDate, endDate, taxAgentId) {
let declareMonth = []
if(startDate != "" && startDate != undefined) {
declareMonth.push(startDate);
}
render() {
const {
taxAgentStore: { taxAgentOption },
} = this.props;
const { otherDeductStore } = this.props;
const {
slideTableStore,
currentRecord,
slideColumns,
slidePageObj,
slideTableDataSource,
setSlidePageObj,
slideLoading,
} = otherDeductStore;
const { startDate, endDate, taxAgentId } = this.state;
if(endDate != "" && endDate != undefined) {
declareMonth.push(endDate);
}
let item = {
taxAgentId: taxAgentId
}
if(declareMonth.length != 0) {
item.declareMonth = declareMonth
}
this.fetchCumDeductDetailList(item)
}
const pagination = {
total: slidePageObj.total,
showTotal: (total) => `${total}`,
showSizeChanger: true,
onShowSizeChange(current, pageSize) {
setSlidePageObj({ ...slidePageObj, current, pageSize });
},
onChange(current) {
setSlidePageObj({
...slidePageObj,
current,
pageSize: slidePageObj.pageSize,
});
},
};
const newColumns = _.map([...slideColumns], (item) => {
if (item.dataIndex === "declareMonth") {
return {
...item,
width: 120,
fixed: "left",
};
} else {
return { ...item };
}
});
const rowSelection = {
selectedRowKeys: this.props.slideSelectedKey,
onChange: this.onSelectChange,
};
return (
<div className="cumDeductSlide">
<Row className="topLabelBar">
<Col span={4}>
<span className="username">{currentRecord.username}</span>
</Col>
<Col span={12}>
<span className="formLabel">申报月份</span>
<div className="weaRangePickerWrapper">
<div className="monthPickerWrapper">
<MonthPicker
width={100}
format="YYYY-MM"
value={startDate}
onChange={(v) => {
let startDate = "";
if (v != "" && v != undefined) {
startDate = moment(v).format("YYYY-MM");
}
this.setState({ startDate });
this.handleFetchCumDeductDetailList(
startDate,
endDate,
taxAgentId
);
}}
/>
</div>
<span className="betweenLable"></span>
<div className="monthPickerWrapper">
<MonthPicker
width={100}
value={endDate}
onChange={(v) => {
let endDate = "";
if (v != "" && v != undefined) {
endDate = moment(v).format("YYYY-MM");
}
this.setState({ endDate });
this.handleFetchCumDeductDetailList(
startDate,
endDate,
taxAgentId
);
}}
/>
</div>
</div>
</Col>
<Col span={8}>
<span className="formLabel">个税扣缴义务人</span>
<WeaSelect
showSearch // 设置select可搜索
style={{ width: 100 }}
options={taxAgentOption}
value={taxAgentId}
onChange={(v) => {
this.setState({ taxAgentId: v });
this.handleFetchCumDeductDetailList(startDate, endDate, v);
}}
/>
</Col>
</Row>
render() {
const { taxAgentStore: {taxAgentOption}} = this.props;
const { otherDeductStore } = this.props;
const { slideTableStore, currentRecord } = otherDeductStore;
const { startDate, endDate, taxAgentId } = this.state;
return (
<div className="cumDeductSlide">
<Row className="topLabelBar">
<Col span={4}>
<span className="username">{currentRecord.username}</span>
</Col>
<Col span={12}>
<span className="formLabel">申报月份</span>
<div className="weaRangePickerWrapper">
<div className="monthPickerWrapper">
<MonthPicker width={100} format="YYYY-MM" value={startDate}
onChange={(v) => {
let startDate = "";
if(v != "" && v!= undefined) {
startDate = moment(v).format("YYYY-MM")
}
this.setState({startDate})
this.handleFetchCumDeductDetailList(startDate, endDate, taxAgentId)
}}
/>
</div>
<span className="betweenLable">
</span>
<div className="monthPickerWrapper">
<MonthPicker width={100}
value={endDate}
onChange={(v) => {
let endDate = ""
if(v != "" && v!= undefined) {
endDate = moment(v).format("YYYY-MM")
}
this.setState({endDate})
this.handleFetchCumDeductDetailList(startDate, endDate, taxAgentId)
}}
/>
</div>
</div>
</Col>
<Col span={8}>
<span className="formLabel">个税扣缴义务人</span>
<WeaSelect
showSearch // 设置select可搜索
style={{ width: 100 }}
options={taxAgentOption}
value={taxAgentId}
onChange={v => {
this.setState({taxAgentId: v})
this.handleFetchCumDeductDetailList(startDate, endDate, v)
}}
/>
</Col>
</Row>
<div>
<WeaTable // table内部做了loading加载处理页面就不需要再加了
comsWeaTableStore={slideTableStore} // table store
hasOrder={true} // 是否启用排序
needScroll={true} // 是否启用table内部列表滚动将自适应到父级高度
scroll={{x: slideTableStore.columns.length * 100}}
/>
</div>
</div>
)
}
}
<div>
<WeaTable
rowKey="id"
rowSelection={rowSelection}
columns={newColumns}
dataSource={slideTableDataSource}
pagination={pagination}
loading={slideLoading}
scroll={{ x: 900 }}
/>
</div>
</div>
);
}
}

View File

@ -1,61 +1,81 @@
import React from 'react';
import { inject, observer } from 'mobx-react';
import { toJS } from 'mobx';
import { Button, Table, DatePicker, Dropdown, Menu, Modal, message, Row, Col } from 'antd';
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaDatePicker, WeaSelect, WeaHelpfulTip, WeaSlideModal } from 'ecCom';
import { WeaTableNew } from "comsMobx"
import moment from 'moment';
const WeaTable = WeaTableNew.WeaTable;
import { renderNoright, getSearchs } from '../../../util'; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import CustomTab from '../../../components/customTab';
import ContentWrapper from '../../../components/contentWrapper';
import ImportModal from '../../../components/importModal'
import { columns, dataSource, modalColumns } from './columns';
import React from "react";
import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
import {
Button,
Table,
DatePicker,
Dropdown,
Menu,
Modal,
message,
Row,
Col,
} from "antd";
import {
WeaTop,
WeaTab,
WeaRightMenu,
WeaRangePicker,
WeaDatePicker,
WeaSelect,
WeaHelpfulTip,
WeaSlideModal,
WeaTable,
} from "ecCom";
import moment from "moment";
import { renderNoright, getSearchs } from "../../../util"; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import CustomTab from "../../../components/customTab";
import ContentWrapper from "../../../components/contentWrapper";
import ImportModal from "../../../components/importModal";
import { modalColumns } from "./columns";
const { MonthPicker } = DatePicker;
import "./index.less"
import "./index.less";
import SlideModalTitle from '../../../components/slideModalTitle';
import EditSlideContent from './editSlideContent';
import SlideModalTitle from "../../../components/slideModalTitle";
import EditSlideContent from "./editSlideContent";
@inject('otherDeductStore', "taxAgentStore")
@inject("otherDeductStore", "taxAgentStore")
@observer
export default class OtherDeduct extends React.Component {
constructor(props) {
super(props);
this.state = {
value: "",
selectedKey: "0",
selectedKey: [],
slideSelectedKey: [], //详情表格的选中项
visiable: false,
monthValue: moment(new Date()).format("YYYY-MM"),
monthValue: "",
taxAgentId: "",
inited: false,
modalParam: {
declareMonth: "",
}
}
},
};
}
componentWillMount() { // 初始化渲染页面
const { otherDeductStore: { doInit }, taxAgentStore: { fetchTaxAgentOption } } = this.props;
componentWillMount() {
// 初始化渲染页面
const {
otherDeductStore: { doInit },
taxAgentStore: { fetchTaxAgentOption },
} = this.props;
doInit();
fetchTaxAgentOption().then(() => {
this.setState({
inited: true
})
})
inited: true,
});
});
}
getSearchsAdQuick() {
const { monthValue, taxAgentId } = this.state;
const { taxAgentStore: { taxAgentOption }, otherDeductStore: {form, getTableDatas} } = this.props;
const {
taxAgentStore: { taxAgentOption },
otherDeductStore: { form, getTableDatas },
} = this.props;
return (
<div className="searchConditionWrapper">
<div className="searchConditionItem">
@ -64,9 +84,9 @@ export default class OtherDeduct extends React.Component {
value={monthValue}
format="YYYY-MM"
width={200}
onChange={v => {
this.setState({monthValue: v})
getTableDatas({ declareMonth: [v], taxAgentId })
onChange={(v) => {
this.setState({ monthValue: v });
getTableDatas({ declareMonth: v && [v], taxAgentId });
}}
/>
</div>
@ -81,199 +101,353 @@ export default class OtherDeduct extends React.Component {
<div className="searchConditionItem">
<span className="conditionFormLabel">个税扣缴义务人:</span>
{
this.state.inited && <WeaSelect
{this.state.inited && (
<WeaSelect
showSearch // 设置select可搜索
style={{ width: 200 }}
options={taxAgentOption}
value={taxAgentId}
onChange={v => {
this.setState({taxAgentId: v})
getTableDatas({ taxAgentId: v, declareMonth: [monthValue]})
onChange={(v) => {
this.setState({ taxAgentId: v });
getTableDatas({
taxAgentId: v,
declareMonth: monthValue && [monthValue],
});
}}
/>
}
)}
</div>
</div>
)
);
}
onEdit = (record) => {
const { otherDeductStore: { slideVisiable, setSlideVisiable, getOtherDeductDetailList, setCurrentRecord } } = this.props;
setSlideVisiable(true)
setCurrentRecord(record)
const {
otherDeductStore: {
slideVisiable,
setSlideVisiable,
getOtherDeductDetailList,
setCurrentRecord,
},
} = this.props;
setSlideVisiable(true);
setCurrentRecord(record);
getOtherDeductDetailList(record.id);
}
};
// 增加编辑功能重写columns绑定事件
getColumns = (columns) => {
let newColumns = '';
newColumns = columns.map(column => {
let newColumns = "";
newColumns = columns.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 <a onClick={() => {this.onEdit(record)}}
dangerouslySetInnerHTML={{ __html: valueSpan }} />
return (
<a
onClick={() => {
this.onEdit(record);
}}
dangerouslySetInnerHTML={{ __html: valueSpan }}
/>
);
case "operate":
return <a onClick={() => {this.onEdit(record)}}>查看明细</a>
return (
<a
onClick={() => {
this.onEdit(record);
}}>
查看明细
</a>
);
default:
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />;
}
}
};
return newColumn;
});
return newColumns;
}
};
handleCancel() {
const { otherDeductStore } = this.props;
const { modalVisiable, setModalVisiable, setStep } = otherDeductStore
const { modalVisiable, setModalVisiable, setStep } = otherDeductStore;
setModalVisiable(false);
setStep(0);
}
onOperatesClick = (record, index, operate, flag) => {
switch(operate.index.toString()){
case '0': // 查看明细
switch (operate.index.toString()) {
case "0": // 查看明细
this.onEdit(record);
break;
}
};
renderFormComponent() {
const { modalParam } = this.state
const { taxAgentStore: {taxAgentOption} } = this.props;
const { modalParam } = this.state;
const {
taxAgentStore: { taxAgentOption },
} = this.props;
return (
<Row>
<Col span={12}>
<span className="formLabel" style={{ lineHeight: "30px", marginRight: "10px" }}>税款所属期</span>
<WeaDatePicker
format="yyyy-MM"
value={modalParam.declareMonth}
onChange={value => this.setState({ modalParam: {declareMonth: value} })}
/>
</Col>
</Row>
)
<Row>
<Col span={12}>
<span
className="formLabel"
style={{ lineHeight: "30px", marginRight: "10px" }}>
税款所属期
</span>
<WeaDatePicker
format="yyyy-MM"
value={modalParam.declareMonth}
onChange={(value) =>
this.setState({ modalParam: { declareMonth: value } })
}
/>
</Col>
</Row>
);
}
showColumn = () => {
const { otherDeductStore: { tableStore } } = this.props;
const {
otherDeductStore: { tableStore },
} = this.props;
tableStore.setColSetVisible(true);
tableStore.tableColSet(true);
}
};
// 初始化导入参数
handleInitImport() {
const { otherDeductStore: {setSlideDataSource, setImportResult}} = this.props;
setSlideDataSource([])
setImportResult({})
const {
otherDeductStore: { setSlideDataSource, setImportResult },
} = this.props;
setSlideDataSource([]);
setImportResult({});
}
onSelectChange = (val) => {
this.setState({
selectedKey: val,
});
};
render() {
const { otherDeductStore, taxAgentStore } = this.props;
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd, previewImport, importFile } = otherDeductStore;
const { taxAgentOption } = taxAgentStore
const { slideVisiable, setSlideVisiable, modalVisiable, setModalVisiable, slideTableStore, step, setStep, slideDataSource, importResult } = otherDeductStore
const selectedRowKeys = toJS(tableStore.selectedRowKeys) || [];
const { modalParam } = this.state;
const { otherDeductStore, taxAgentStore, slideSelectedKey } = this.props;
const {
loading,
dataSource,
columns,
pageObj,
hasRight,
form,
condition,
tableStore,
showSearchAd,
getTableDatas,
doSearch,
setShowSearchAd,
previewImport,
importFile,
} = otherDeductStore;
const { taxAgentOption } = taxAgentStore;
const {
slideVisiable,
setSlideVisiable,
modalVisiable,
setModalVisiable,
slideTableStore,
step,
setStep,
slideDataSource,
importResult,
setPageObj,
} = otherDeductStore;
const selectedRowKeys = toJS(tableStore.selectedRowKeys) || [];
const { modalParam, monthValue, taxAgentId } = this.state;
const detailSelectedRowKeys = toJS(slideTableStore.selectedRowKeys) || [];
if (!hasRight && !loading) { // 无权限处理
if (!hasRight && !loading) {
// 无权限处理
return renderNoright();
}
const rightMenu = [// 右键菜单
{
key: 'BTN_COLUMN',
icon: <i className='icon-coms-Custom' />,
content: '显示列定制',
onClick: this.showColumn
},
const rightMenu = [
// 右键菜单
// {
// key: "BTN_COLUMN",
// icon: <i className="icon-coms-Custom" />,
// content: "显示列定制",
// onClick: this.showColumn,
// },
];
const collectParams = { // 收藏功能配置
favname: '其他免税扣除',
const collectParams = {
// 收藏功能配置
favname: "其他免税扣除",
favouritetype: 1,
objid: 0,
link: 'wui/index.html#/ns_demo03/index',
link: "wui/index.html#/ns_demo03/index",
importantlevel: 1,
};
const adBtn = [ // 高级搜索内部按钮
<Button type="primary" onClick={doSearch}>搜索</Button>,
<Button type="ghost" onClick={() => form.resetForm()}>重置</Button>,
<Button type="ghost" onClick={() => setShowSearchAd(false)}>取消</Button>,
const adBtn = [
// 高级搜索内部按钮
<Button type="primary" onClick={doSearch}>
搜索
</Button>,
<Button type="ghost" onClick={() => form.resetForm()}>
重置
</Button>,
<Button type="ghost" onClick={() => setShowSearchAd(false)}>
取消
</Button>,
];
const topTab = [
];
const topTab = [];
const renderSearchOperationItem = () => {
return <div></div>
}
return <div></div>;
};
const handleButtonClick = () => {
const { otherDeductStore: {exportOtherDeductList}} = this.props;
const {
otherDeductStore: { exportOtherDeductList },
} = this.props;
exportOtherDeductList();
}
};
const handleMenuClick = () => {
if(selectedRowKeys.length == 0) {
message.warning("未选择条目")
return
if (selectedRowKeys.length == 0) {
message.warning("未选择条目");
return;
}
const { otherDeductStore: { exportOtherDeductList } } = this.props;
exportOtherDeductList(selectedRowKeys.join(","))
}
const {
otherDeductStore: { exportOtherDeductList },
} = this.props;
exportOtherDeductList(selectedRowKeys.join(","));
};
const handleBtnImport = () => {
const { otherDeductStore: { setModalVisiable, setStep } } = this.props;
const {
otherDeductStore: { setModalVisiable, setStep },
} = this.props;
setStep(0);
setModalVisiable(true)
}
setModalVisiable(true);
};
const btns = [
<Button type="primary" onClick={() => { handleBtnImport() }}>导入</Button>,
<Dropdown.Button onClick={handleButtonClick} overlay={
<Menu onClick={handleMenuClick}>
<Menu.Item key="1">导出选中</Menu.Item>
</Menu>
} type="ghost">
<Button
type="primary"
onClick={() => {
handleBtnImport();
}}>
导入
</Button>,
<Dropdown.Button
onClick={handleButtonClick}
overlay={
<Menu onClick={handleMenuClick}>
<Menu.Item key="1">导出选中</Menu.Item>
</Menu>
}
type="ghost">
导出全部
</Dropdown.Button>
]
</Dropdown.Button>,
];
const handleExportAllDetailClick = () => {
const {otherDeductStore: {exportOtherDeductDetailList, currentRecord} } =this.props;
const {
otherDeductStore: { exportOtherDeductDetailList, currentRecord },
} = this.props;
exportOtherDeductDetailList(currentRecord.id);
}
};
const handleExportSelectedDetailClick = () => {
if(detailSelectedRowKeys.length == 0) {
message.warning("未选择条目")
return
if (this.state.slideSelectedKey.length == 0) {
message.warning("未选择条目");
return;
}
const { otherDeductStore: { exportOtherDeductDetailList, currentRecord } } = this.props;
exportOtherDeductDetailList(currentRecord.id, detailSelectedRowKeys.join(","))
}
const {
otherDeductStore: { exportOtherDeductDetailList, currentRecord },
} = this.props;
exportOtherDeductDetailList(
currentRecord.id,
this.state.slideSelectedKey.join(",")
);
};
const renderBtns = () => {
return (
<Dropdown.Button onClick={handleExportAllDetailClick} overlay={
<Menu onClick={handleExportSelectedDetailClick}>
<Menu.Item key="1">导出选中</Menu.Item>
</Menu>
} type="ghost">
<Dropdown.Button
onClick={handleExportAllDetailClick}
overlay={
<Menu onClick={handleExportSelectedDetailClick}>
<Menu.Item key="1">导出选中</Menu.Item>
</Menu>
}
type="ghost">
导出全部
</Dropdown.Button>
)
}
</Dropdown.Button>
);
};
const rowSelection = {
selectedRowKeys: this.state.selectedKey,
onChange: this.onSelectChange,
};
const pagination = {
total: pageObj.total,
showTotal: (total) => `${total}`,
showSizeChanger: true,
onShowSizeChange(current, pageSize) {
setPageObj({ ...pageObj, current, pageSize });
},
onChange(current) {
setPageObj({ ...pageObj, current, pageSize: pageObj.pageSize });
},
};
const newColumns = _.map([...columns], (item) => {
if (item.dataIndex === "username") {
return {
...item,
width: 100,
fixed: "left",
render: (text, record) => (
<div className="linkWapper">
<a href="javaScript:void(0);" onClick={() => this.onEdit(record)}>
{text}
</a>
</div>
),
};
} else if (item.dataIndex === "taxAgentName") {
return {
...item,
width: 180,
fixed: "left",
};
} else if (item.dataIndex === "operate") {
return {
...item,
width: 100,
fixed: "right",
render: (text, record) => (
<div className="linkWapper">
<a href="javaScript:void(0);" onClick={() => this.onEdit(record)}>
查看明细
</a>
</div>
),
};
} else {
return { ...item };
}
});
return (
<div className="cumDeductWrapper">
@ -282,80 +456,104 @@ export default class OtherDeduct extends React.Component {
>
<WeaTop
title="其他免税扣除" // 文字
icon={<i className='icon-coms-meeting' />} // 左侧图标
iconBgcolor='#F14A2D' // 左侧图标背景色
icon={<i className="icon-coms-meeting" />} // 左侧图标
iconBgcolor="#F14A2D" // 左侧图标背景色
showDropIcon={true} // 是否显示下拉按钮
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
buttons={btns}
>
buttons={btns}>
<div className="weaTabWrapper">
<WeaTab
searchType={['base', 'advanced']} // base基础搜索框 advanced显示高级搜索按钮
searchType={["base", "advanced"]} // base基础搜索框 advanced显示高级搜索按钮
showSearchAd={showSearchAd} // 是否展开高级搜索面板
setShowSearchAd={bool => setShowSearchAd(bool)} //高级搜索面板受控
setShowSearchAd={(bool) => setShowSearchAd(bool)} //高级搜索面板受控
searchsAd={getSearchs(form, toJS(condition), 2)} // 高级搜索内部数据
buttonsAd={adBtn} // 高级搜索内部按钮
onSearch={getTableDatas} // 点搜索按钮时的回调
onSearch={() =>
getTableDatas({
taxAgentId,
declareMonth: monthValue && [monthValue],
})
} // 点搜索按钮时的回调
searchsAdQuick={this.getSearchsAdQuick()}
onSearchChange={v => form.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
onSearchChange={(v) => form.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
searchsBaseValue={form.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步
/>
</div>
<WeaTable // table内部做了loading加载处理页面就不需要再加了
comsWeaTableStore={tableStore} // table store
hasOrder={true} // 是否启用排序
needScroll={true} // 是否启用table内部列表滚动将自适应到父级高度
getColumns={this.getColumns}
onOperatesClick={this.onOperatesClick.bind(this)}
<WeaTable
rowKey="id"
rowSelection={rowSelection}
columns={newColumns}
dataSource={dataSource}
pagination={pagination}
loading={loading}
scroll={{ x: 1300 }}
/>
</WeaTop>
</WeaRightMenu>
{
modalVisiable && <ImportModal
{modalVisiable && (
<ImportModal
init={() => {
this.handleInitImport()
this.handleInitImport();
}}
templateLink={"/api/bs/hrmsalary/otherDeduction/downloadTemplate"}
params={modalParam}
columns={modalColumns}
step={step}
setStep={setStep}
onFinish={() => {setModalVisiable(false); setStep(0); doSearch();}}
onFinish={() => {
setModalVisiable(false);
setStep(0);
doSearch();
}}
importResult={importResult}
slideDataSource={slideDataSource}
previewImport={(params) => {previewImport(params)}}
importFile={(params) => {importFile(params)}}
renderFormComponent={() => this.renderFormComponent()}
visiable={modalVisiable}
onCancel={() => { this.handleCancel() }}
/>
}
{
slideVisiable && <WeaSlideModal visible={slideVisiable}
top={0}
width={60}
height={100}
direction={'right'}
measure={'%'}
title={
<SlideModalTitle
subtitle={"其他免税扣除记录"}
subTabs={[{title: "基础设置"}]}
onSave={() => {this.state.currentOperate == "add" ? doSave() : doUpdate()}}
editable={false}
btns={
renderBtns()
}
/>
}
content={(<EditSlideContent />)}
onClose={() => setSlideVisiable(false)}
showMask={true}
closeMaskOnClick={() => setSlideVisiable(false)} />
}
previewImport={(params) => {
previewImport(params);
}}
importFile={(params) => {
importFile(params);
}}
renderFormComponent={() => this.renderFormComponent()}
visiable={modalVisiable}
onCancel={() => {
this.handleCancel();
}}
/>
)}
{slideVisiable && (
<WeaSlideModal
visible={slideVisiable}
top={0}
width={60}
height={100}
direction={"right"}
measure={"%"}
title={
<SlideModalTitle
subtitle={"其他免税扣除记录"}
subTabs={[{ title: "基础设置" }]}
onSave={() => {
this.state.currentOperate == "add" ? doSave() : doUpdate();
}}
editable={false}
btns={renderBtns()}
/>
}
content={
<EditSlideContent
slideSelectedKey={slideSelectedKey}
onChangeSlideSelectKey={(val) =>
this.setState({ slideSelectedKey: val })
}
/>
}
onClose={() => setSlideVisiable(false)}
showMask={true}
closeMaskOnClick={() => setSlideVisiable(false)}
/>
)}
</div>
)
);
}
}

View File

@ -0,0 +1,11 @@
.cumDeductWrapper {
.linkWapper {
a {
color: #4d7ad8;
}
a:hover {
text-decoration: none;
}
}
}

View File

@ -77,12 +77,16 @@ export default class CalRulesForm extends React.Component {
}
render() {
const { ledgerStore: {sobItemRuleDataSource}} = this.props;
const { ledgerStore: {sobItemRuleDataSource,baseInfoRequest}} = this.props;
const { canEdit="true" } = baseInfoRequest;
let datas = this.convertDataSource(sobItemRuleDataSource)
return (
<div className="calRulesForm">
<div className="headerIcon">
<Icon className="iconItem" type="plus-square" onClick={() => {this.setState({modalVisible: true})}}/>
{
canEdit ==='true'&&
<Icon className="iconItem" type="plus-square" onClick={() => {this.setState({modalVisible: true})}}/>
}
</div>
<div className="tableWrapper">
<WeaTable dataSource={datas} columns={this.state.slideStep4Columns} pagination={false}/>

View File

@ -1,30 +1,36 @@
import React from 'react';
import { inject, observer } from 'mobx-react';
import { toJS } from 'mobx';
import React from "react";
import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
import { Button, Table, DatePicker, Switch, Modal } from 'antd';
import { Button, Table, DatePicker, Switch, Modal, Dropdown, Menu } from "antd";
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaInputSearch, WeaSlideModal } from 'ecCom';
import { WeaTableNew } from "comsMobx"
import { renderNoright, getSearchs } from '../../util'; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import CustomTab from '../../components/customTab';
import ContentWrapper from '../../components/contentWrapper';
import StepSlide from '../../components/stepSlide'
import SlideBaseForm from './slideBaseForm'
import SlideRefereUser from './slideRefereUser'
import {
WeaTop,
WeaTab,
WeaRightMenu,
WeaRangePicker,
WeaInputSearch,
WeaSlideModal,
WeaTable,
} from "ecCom";
import { renderNoright, getSearchs } from "../../util"; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import CustomTab from "../../components/customTab";
import ContentWrapper from "../../components/contentWrapper";
import StepSlide from "../../components/stepSlide";
import SlideBaseForm from "./slideBaseForm";
import SlideRefereUser from "./slideRefereUser";
import { columns, dataSource } from './columns';
import SalaryItemForm from './salaryItemForm';
import CalRulesForm from './calcRulesForm';
import ValidRulesForm from './validRulesForm';
import SlideModalTitle from '../../components/slideModalTitle'
import CopyFormModal from './copyFormModal'
import { columns } from "./columns";
import SalaryItemForm from "./salaryItemForm";
import CalRulesForm from "./calcRulesForm";
import ValidRulesForm from "./validRulesForm";
import SlideModalTitle from "../../components/slideModalTitle";
import CopyFormModal from "./copyFormModal";
import "./index.less";
const { MonthPicker } = DatePicker;
const WeaTable = WeaTableNew.WeaTable;
@inject('ledgerStore')
@inject("ledgerStore", "taxAgentStore")
@observer
export default class Ledger extends React.Component {
constructor(props) {
@ -39,224 +45,393 @@ export default class Ledger extends React.Component {
selectedTab: 0,
currentReocrd: {},
searchValue: "",
step1Request: {}
}
step1Request: {},
};
}
handleSearch(value) {
const{ ledgerStore: {getTableDatas}} = this.props;
getTableDatas({name: value})
const {
ledgerStore: { getTableDatas },
} = this.props;
getTableDatas({ name: value });
}
refereUser() {
this.setState({
editSlideVisible: true,
selectedTab: 1
})
selectedTab: 1,
});
}
onEdit() {
this.setState({
editSlideVisible: true
})
editSlideVisible: true,
});
}
componentWillMount() {
const { ledgerStore : {doInit}} = this.props;
doInit()
const {
ledgerStore: { doInit },
taxAgentStore: { fetchTaxAgentOption },
} = this.props;
doInit();
fetchTaxAgentOption();
}
handleItemStatusChange(value, record) {
const { ledgerStore: { changeLedgerStatus }} = this.props;
const {
ledgerStore: { changeLedgerStatus },
} = this.props;
changeLedgerStatus(record.id, value ? 0 : 1);
}
handleItemClick(record, selectedTab = 0) {
const { ledgerStore: {setSalarySobId} } = this.props;
setSalarySobId(record.id)
const {
ledgerStore: { setSalarySobId },
} = this.props;
setSalarySobId(record.id);
this.setState({
selectedTab,
editSlideVisible: true,
request: record
})
request: record,
});
}
// 编辑Slide保存按钮
handleEditSlideSave() {
const { selectedTab, step1Request } = this.state;
const { ledgerStore: {saveLedgerItem, saveAdjustmentRule, saveLedgerBasic, baseInfoRequest}} = this.props;
if(selectedTab == 0) {
saveLedgerBasic(baseInfoRequest)
} else if(selectedTab == 2) {
saveLedgerItem()
} else if(selectedTab == 3) {
saveAdjustmentRule()
}
const {
ledgerStore: {
saveLedgerItem,
saveAdjustmentRule,
saveLedgerBasic,
baseInfoRequest,
},
} = this.props;
if (selectedTab == 0) {
saveLedgerBasic(baseInfoRequest);
} else if (selectedTab == 2) {
saveLedgerItem();
} else if (selectedTab == 3) {
saveAdjustmentRule();
}
}
// 增加编辑功能重写columns绑定事件
getColumns = (columns) => {
let newColumns = '';
newColumns = columns.map(column => {
let newColumns = "";
newColumns = columns.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) {
case 'name':
return <a onClick={() => {this.handleItemClick(record)}}>{text}</a>
newColumn.render = (text, record, index) => {
//前端元素转义
let valueSpan =
record[newColumn.dataIndex + "span"] !== undefined
? record[newColumn.dataIndex + "span"]
: record[newColumn.dataIndex];
switch (newColumn.dataIndex) {
case "name":
return (
<a
onClick={() => {
this.handleItemClick(record);
}}>
{text}
</a>
);
case "disable":
return <Switch checked={text == 0} onChange={(value) => {this.handleItemStatusChange(value, record)}}/>
return (
<Switch
checked={text == 0}
onChange={(value) => {
this.handleItemStatusChange(value, record);
}}
/>
);
case "operate":
return <a onClick={() => {this.handleItemClick(record, 1)}}>关联人员</a>
return (
<a
onClick={() => {
this.handleItemClick(record, 1);
}}>
关联人员
</a>
);
default:
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />;
}
}
};
return newColumn;
});
return newColumns;
}
};
onOperatesClick = (record, index, operate, flag) => {
const { ledgerStore: { deleteLedger }} = this.props;
switch(operate.index.toString()){
onOperatesClick = (record, type) => {
const {
ledgerStore: { deleteLedger },
} = this.props;
switch (type.toString()) {
case "0": // 编辑
this.handleItemClick(record)
this.handleItemClick(record);
break;
case '1': // 复制
case "1": // 复制
this.setState({
copyFormVisible: true,
currentReocrd: record
})
currentReocrd: record,
});
break;
case "3": // 关联人员
this.handleItemClick(record, 1)
this.handleItemClick(record, 1);
break;
case "4": // 删除
Modal.confirm({
title: '信息确认',
content: '确认删除',
onOk:() => {
deleteLedger([record.id])
},
onCancel: () => {
title: "信息确认",
content: "确认删除",
onOk: () => {
deleteLedger([record.id]);
},
onCancel: () => {},
});
break;
}
};
handleCopySave = (value) => {
const { ledgerStore: { doCopy}} = this.props
const {
ledgerStore: { doCopy },
} = this.props;
doCopy(this.state.currentReocrd.id, value).then(() => {
this.setState({copyFormVisible: false})
})
}
this.setState({ copyFormVisible: false });
});
};
handleNew = () => {
const { ledgerStore: { initSlideData }} = this.props;
const {
ledgerStore: { initSlideData },
} = this.props;
initSlideData();
this.setState({stepSlideVisible: true, currentStep: 0})
}
this.setState({ stepSlideVisible: true, currentStep: 0 });
};
render() {
const { ledgerStore } = this.props;
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = ledgerStore;
const {
loading,
dataSource,
columns,
pageObj,
setPageObj,
hasRight,
form,
condition,
tableStore,
showSearchAd,
getTableDatas,
doSearch,
setShowSearchAd,
baseInfoRequest,
} = ledgerStore;
const { canEdit = "true" } = baseInfoRequest;
const { currentStep, selectedTab } = this.state;
if (!hasRight && !loading) { // 无权限处理
if (!hasRight && !loading) {
// 无权限处理
return renderNoright();
}
const rightMenu = [// 右键菜单
{
key: 'BTN_COLUMN',
icon: <i className='icon-coms-Custom' />,
content: '显示列定制',
onClick: this.showColumn
const rightMenu = [
// 右键菜单
{
key: "BTN_COLUMN",
icon: <i className="icon-coms-Custom" />,
content: "显示列定制",
onClick: this.showColumn,
},
];
const collectParams = { // 收藏功能配置
favname: '薪资账套',
const collectParams = {
// 收藏功能配置
favname: "薪资账套",
favouritetype: 1,
objid: 0,
link: 'wui/index.html#/ns_demo03/index',
link: "wui/index.html#/ns_demo03/index",
importantlevel: 1,
};
const adBtn = [ // 高级搜索内部按钮
<Button type="primary" onClick={doSearch}>搜索</Button>,
<Button type="ghost" onClick={() => form.resetForm()}>重置</Button>,
<Button type="ghost" onClick={() => setShowSearchAd(false)}>取消</Button>,
const adBtn = [
// 高级搜索内部按钮
<Button type="primary" onClick={doSearch}>
搜索
</Button>,
<Button type="ghost" onClick={() => form.resetForm()}>
重置
</Button>,
<Button type="ghost" onClick={() => setShowSearchAd(false)}>
取消
</Button>,
];
const topTab = [
];
const topTab = [];
const renderRightOperation = () => {
return (
<div style={{display: "inline-block"}}>
<Button type="primary" style={{marginRight: "10px"}} onClick={() => this.handleNew()}>新建</Button>
<WeaInputSearch value={this.state.searchValue} onChange={(value) => {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/>
<div style={{ display: "inline-block" }}>
<Button
type="primary"
style={{ marginRight: "10px" }}
onClick={() => this.handleNew()}>
新建
</Button>
<WeaInputSearch
value={this.state.searchValue}
onChange={(value) => {
this.setState({ searchValue: value });
}}
onSearch={(value) => {
this.handleSearch(value);
}}
/>
</div>
)
}
);
};
const nextStep = () => {
const { currentStep } = this.state;
this.setState({currentStep: currentStep + 1})
}
this.setState({ currentStep: currentStep + 1 });
};
const prevStep = () => {
const { currentStep } = this.state;
this.setState({currentStep: currentStep - 1});
}
this.setState({ currentStep: currentStep - 1 });
};
const steps = [
"基础设置",
"关联人员",
"薪资项目",
"调薪记薪规则",
// "校验规则",
]
];
const handleStep1Save = () => {
const { step1Request } = this.state;
const { ledgerStore: {saveLedgerBasic, baseInfoRequest} } = this.props;
const {
ledgerStore: { saveLedgerBasic, baseInfoRequest },
} = this.props;
saveLedgerBasic(baseInfoRequest).then(() => {
nextStep();
})
}
});
};
const handleStep3Save = () => {
const { ledgerStore: {saveAdjustmentRule} } = this.props;
const {
ledgerStore: { saveAdjustmentRule },
} = this.props;
saveAdjustmentRule().then(() => {
nextStep()
})
}
nextStep();
});
};
const handleStepSave = () => {
const { currentStep } = this.state;
const { ledgerStore: { saveLedgerBasic, saveLedgerItem, saveAdjustmentRule, baseInfoRequest }} = this.props;
if(currentStep == 0) {
const {
ledgerStore: {
saveLedgerBasic,
saveLedgerItem,
saveAdjustmentRule,
baseInfoRequest,
},
} = this.props;
if (currentStep == 0) {
saveLedgerBasic(baseInfoRequest).then(() => {
nextStep();
})
} else if(currentStep == 1) {
nextStep()
}else if(currentStep == 2) {
});
} else if (currentStep == 1) {
nextStep();
} else if (currentStep == 2) {
saveLedgerItem().then(() => {
nextStep()
})
} else if(currentStep == 3) {
nextStep();
});
} else if (currentStep == 3) {
saveAdjustmentRule().then(() => {
this.setState({stepSlideVisible: false})
})
}
}
this.setState({ stepSlideVisible: false });
});
}
};
const pagination = {
total: pageObj.total,
showTotal: (total) => `${total}`,
showSizeChanger: true,
onShowSizeChange(current, pageSize) {
setPageObj({ ...pageObj, current, pageSize });
getTableDatas({ current, pageSize, name: this.state.searchValue });
},
onChange(current) {
setPageObj({ ...pageObj, current, pageSize: pageObj.pageSize });
getTableDatas({
current,
pageSize: pageObj.pageSize,
name: this.state.searchValue,
});
},
};
const newColumns = _.map([...columns], (item) => {
if (item.dataIndex === "name") {
return {
...item,
render: (text, record) => (
<div className="linkWapper">
<a
href="javaScript:void(0);"
onClick={() => {
this.handleItemClick(record);
}}>
{text}
</a>
</div>
),
};
} else if (item.dataIndex === "disable") {
return {
...item,
render: (text, record) => (
<Switch
checked={text == 0}
onChange={(value) => {
this.handleItemStatusChange(value, record);
}}
/>
),
};
} else if (item.dataIndex === "operate") {
return {
...item,
render: (text, record) => (
<div className="linkWapper">
<a
onClick={() => {
this.handleItemClick(record, 1);
}}>
关联人员
</a>
<Dropdown
overlay={
<Menu
onClick={(item) => this.onOperatesClick(record, item.key)}>
<Menu.Item key="0">编辑</Menu.Item>
<Menu.Item key="1">复制</Menu.Item>
<Menu.Item key="3">关联人员</Menu.Item>
<Menu.Item key="4">删除</Menu.Item>
</Menu>
}>
<a className="ant-dropdown-link" href="javaScript:void(0);">
<i className="icon-coms-more" style={{ marginLeft: 18 }} />
</a>
</Dropdown>
</div>
),
};
} else {
return { ...item };
}
});
return (
<div className="mySalaryBenefitsWrapper">
@ -266,140 +441,181 @@ export default class Ledger extends React.Component {
>
<WeaTop
title="薪资账套" // 文字
icon={<i className='icon-coms-meeting' />} // 左侧图标
iconBgcolor='#F14A2D' // 左侧图标背景色
icon={<i className="icon-coms-meeting" />} // 左侧图标
iconBgcolor="#F14A2D" // 左侧图标背景色
showDropIcon={true} // 是否显示下拉按钮
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
>
<CustomTab
searchOperationItem={
renderRightOperation()
}
onChange={(v) => {
}}
/>
<WeaTable // table内部做了loading加载处理页面就不需要再加了
comsWeaTableStore={tableStore} // table store
hasOrder={true} // 是否启用排序
needScroll={true} // 是否启用table内部列表滚动将自适应到父级高度
getColumns={this.getColumns}
onOperatesClick={this.onOperatesClick.bind(this)}
<CustomTab
searchOperationItem={renderRightOperation()}
onChange={(v) => {}}
/>
{
this.state.stepSlideVisible && <StepSlide
visible={this.state.stepSlideVisible}
steps={steps}
currentStep={currentStep}
onCancel={() => {this.setState({stepSlideVisible: false})}}
customOperate = {
<div style={{display: "inline-block"}}>
{
currentStep == 0 && <Button type="primary" onClick={() => {handleStep1Save()}}>保存并进入下一步</Button>
}
{
currentStep == 1 && <div style={{display: "inline-block"}}>
<Button type="default" onClick={() => {this.setState({stepSlideVisible: false})}}>完成跳过所有步骤</Button>
<Button type="primary" style={{marginLeft: "10px"}} onClick={() => {handleStepSave()}}>下一步</Button>
</div>
}
{
currentStep == 2 && <div>
<Button type="default" onClick={() => {this.setState({stepSlideVisible: false})}}>完成跳过所有步骤</Button>
<Button type="default" style={{marginLeft: "10px"}} onClick={() => {prevStep()}}>上一步</Button>
<Button type="primary" style={{marginLeft: '10px'}} onClick={() => {handleStepSave()}}>保存并进入下一步</Button>
<WeaTable
rowKey="id"
columns={newColumns}
dataSource={dataSource}
pagination={pagination}
loading={loading}
scroll={{ x: 1300 }}
/>
{this.state.stepSlideVisible && (
<StepSlide
visible={this.state.stepSlideVisible}
steps={steps}
currentStep={currentStep}
onCancel={() => {
this.setState({ stepSlideVisible: false });
}}
customOperate={
<div style={{ display: "inline-block" }}>
{currentStep == 0 && (
<Button
type="primary"
onClick={() => {
handleStep1Save();
}}>
保存并进入下一步
</Button>
)}
{currentStep == 1 && (
<div style={{ display: "inline-block" }}>
<Button
type="default"
onClick={() => {
this.setState({ stepSlideVisible: false });
}}>
完成跳过所有步骤
</Button>
<Button
type="primary"
style={{ marginLeft: "10px" }}
onClick={() => {
handleStepSave();
}}>
下一步
</Button>
</div>
}
{
currentStep == 3 &&
)}
{currentStep == 2 && (
<div>
<Button type="default" style={{marginRight: "10px"}} onClick={() => {prevStep()}}>上一步</Button>
<Button type="primary" onClick={() => {handleStepSave()}}>完成</Button>
<Button
type="default"
onClick={() => {
this.setState({ stepSlideVisible: false });
}}>
完成跳过所有步骤
</Button>
<Button
type="default"
style={{ marginLeft: "10px" }}
onClick={() => {
prevStep();
}}>
上一步
</Button>
<Button
type="primary"
style={{ marginLeft: "10px" }}
onClick={() => {
handleStepSave();
}}>
保存并进入下一步
</Button>
</div>
}
</div>
}
title="新建账套"
content={
<div>
{
currentStep == 0 && <SlideBaseForm />
}
{
currentStep == 1 && <SlideRefereUser />
}
{
currentStep == 2 && <SalaryItemForm />
}
{
currentStep == 3 && <CalRulesForm />
}
{/* {
)}
{currentStep == 3 && (
<div>
<Button
type="default"
style={{ marginRight: "10px" }}
onClick={() => {
prevStep();
}}>
上一步
</Button>
<Button
type="primary"
onClick={() => {
handleStepSave();
}}>
完成
</Button>
</div>
)}
</div>
}
title="新建账套"
content={
<div>
{currentStep == 0 && <SlideBaseForm />}
{currentStep == 1 && <SlideRefereUser />}
{currentStep == 2 && <SalaryItemForm />}
{currentStep == 3 && <CalRulesForm />}
{/* {
currentStep == 4 && <ValidRulesForm />
} */}
</div>
}
</div>
}
/>
}
)}
{
this.state.editSlideVisible &&
<WeaSlideModal visible={this.state.editSlideVisible}
{this.state.editSlideVisible && (
<WeaSlideModal
visible={this.state.editSlideVisible}
top={0}
width={40}
height={100}
direction={'right'}
measure={'%'}
direction={"right"}
measure={"%"}
title={
<SlideModalTitle
<SlideModalTitle
subtitle={"编辑账套"}
tabs={[{title: '基础设置', key: 0}, {title: "关联人员", key: 1}, {title: "薪资项目", key: 2}, {title: '调薪计薪规则', key: 3}]}
editable={true}
tabs={[
{ title: "基础设置", key: 0 },
{ title: "关联人员", key: 1 },
{ title: "薪资项目", key: 2 },
{ title: "调薪计薪规则", key: 3 },
]}
editable={canEdit !== "true"}
selectedTab={selectedTab}
onSave={() => this.handleEditSlideSave()}
subItemChange={
(item) => {this.setState({selectedTab: item.key})}
}
subItemChange={(item) => {
this.setState({ selectedTab: item.key });
}}
/>
}
content={<div>
{
selectedTab == 0 && <SlideBaseForm edit={true} />
}
{
selectedTab == 1 && <SlideRefereUser edit={true} />
}
{
selectedTab == 2 && <SalaryItemForm edit={true}/>
}
{
selectedTab == 3 && <CalRulesForm edit={true}/>
}
{/* {
content={
<div>
{selectedTab == 0 && <SlideBaseForm edit={true} />}
{selectedTab == 1 && <SlideRefereUser edit={true} />}
{selectedTab == 2 && <SalaryItemForm edit={true} />}
{selectedTab == 3 && <CalRulesForm edit={true} />}
{/* {
selectedTab == 4 && <ValidRulesForm edit={true}/>
} */}
</div>}
onClose={() => this.setState({editSlideVisible: false})}
</div>
}
onClose={() => this.setState({ editSlideVisible: false })}
showMask={true}
closeMaskOnClick={() => this.setState({editSlideVisible: false})} />
}
closeMaskOnClick={() =>
this.setState({ editSlideVisible: false })
}
/>
)}
</WeaTop>
</WeaRightMenu>
{
this.state.copyFormVisible &&
<CopyFormModal
{this.state.copyFormVisible && (
<CopyFormModal
visible={this.state.copyFormVisible}
onSave={(value) => this.handleCopySave(value)}
onCancel={() => {this.setState({copyFormVisible: false})}}
onCancel={() => {
this.setState({ copyFormVisible: false });
}}
/>
}
)}
</div>
)
);
}
}

View File

@ -1,146 +1,187 @@
.slideBaseForm {
.leftContentWrapper {
margin: 10px;
border: 1px solid #eee;
border-radius: 5px;
padding: 10px;
}
.rightContentWrapper {
margin: 10px;
}
.leftContentWrapper {
margin: 10px;
border: 1px solid #eee;
border-radius: 5px;
padding: 10px;
}
.rightContentWrapper {
margin: 10px;
}
}
.rightContentWrapper {
.greytip {
color: #999;
line-height: 24px;
font-size: 12px;
}
.tipLabel {
color: #333;
font-size: 14px;
line-height: 26px;
}
.higelinered {
color: red;
}
.greytip {
color: #999;
line-height: 24px;
font-size: 12px;
}
.tipLabel {
color: #333;
font-size: 14px;
line-height: 26px;
}
.higelinered {
color: red;
}
}
.slideRefereUser {
.tabItem {
cursor: pointer;
.tabItem {
cursor: pointer;
}
.refereUserHeader {
height: 47px;
line-height: 47px;
padding-left: 10px;
padding-right: 10px;
}
.headerLeft {
display: inline-block;
color: #666;
.selectedCrumbs {
color: #4ba9f2;
}
.refereUserHeader {
height: 47px;
line-height: 47px;
padding-left: 10px;
padding-right: 10px;
}
.headerLeft {
display: inline-block;
color: #666;
.selectedCrumbs {
color: #4ba9f2;
}
}
.headerIcon {
float: right;
}
.searchInput {
margin-top: 10px;
float: right;
}
.headerIcon {
color: #4ba9f2;
display: inline-block;
.iconItem {
cursor: pointer;
margin-right: 10px;
}
}
.headerIcon {
float: right;
}
.searchInput {
margin-top: 10px;
float: right;
}
.headerIcon {
color: #4ba9f2;
display: inline-block;
.iconItem {
cursor: pointer;
margin-right: 10px;
}
}
}
.salaryItemForm {
padding: 10px 20px;
.btnBar {
height: 47px;
.btns {
display: inline-block;
}
.searchInputWrapper {
float: right;
display: inline-block;
}
padding: 10px 20px;
.btnBar {
height: 47px;
.btns {
display: inline-block;
}
.userInfoWrapper {
overflow: hidden;
.rightBtnsWrapper {
float: right;
display: inline-block;
.iconItem {
margin-right: 10px;
color: #2db7f5;
}
}
.searchInputWrapper {
float: right;
display: inline-block;
}
.userInfoSelected {
margin-top: 10px;
margin-bottom: 10px;
padding: 10px;
border: 1px solid #eee;
border-radius: 5px;
}
.userInfoWrapper {
overflow: hidden;
.rightBtnsWrapper {
float: right;
display: inline-block;
.iconItem {
margin-right: 10px;
color: #2db7f5;
}
}
.tableItemWrapper {
margin-top: 10px;
.rightBtnsWrapper {
float: right;
.iconItem {
margin-right: 10px;
color: #2db7f5;
}
}
.itemTitle {
font-size: 14px;
font-weight: 500;
}
}
.userInfoSelected {
margin-top: 10px;
margin-bottom: 10px;
padding: 10px;
border: 1px solid #eee;
border-radius: 5px;
}
.tableItemWrapper {
margin-top: 10px;
.rightBtnsWrapper {
float: right;
.iconItem {
margin-right: 10px;
color: #2db7f5;
}
}
.itemTitle {
font-size: 14px;
font-weight: 500;
}
}
}
.calRulesForm {
padding: 10px 20px;
.headerIcon {
float: right;
.iconItem {
margin-right: 10px;
color: #2db7f5;
}
}
.tableWrapper {
margin-top: 20px;
padding: 10px 20px;
.headerIcon {
float: right;
.iconItem {
margin-right: 10px;
color: #2db7f5;
}
}
.tableWrapper {
margin-top: 20px;
}
}
.validRulesForm {
padding: 10px 20px;
.headerBar {
height: 47px;
line-height: 47px;
.inputSearch {
margin-top: 8px;
float: right;
}
.btnsWrapper {
float: right;
.iconItem {
margin-right: 10px;
cursor: pointer;
color: #2db7f5;
}
}
padding: 10px 20px;
.headerBar {
height: 47px;
line-height: 47px;
.inputSearch {
margin-top: 8px;
float: right;
}
.tableWrapper {
margin-top: 20px;
.btnsWrapper {
float: right;
.iconItem {
margin-right: 10px;
cursor: pointer;
color: #2db7f5;
}
}
}
.tableWrapper {
margin-top: 20px;
}
}
.mySalaryBenefitsWrapper {
.linkWapper {
a {
color: #4d7ad8;
}
a:hover {
text-decoration: none;
}
}
}

View File

@ -83,14 +83,15 @@ export default class SalaryItemForm extends React.Component {
}
render() {
const {ledgerStore: {itemGroups, salaryItems, empBrowserList, setAddCategoryVisible, addCategoryVisible}} = this.props;
const {ledgerStore: {itemGroups, salaryItems, empBrowserList, setAddCategoryVisible, addCategoryVisible, baseInfoRequest}} = this.props;
const { canEdit="true" } = baseInfoRequest;
const { previewVisible } = this.state;
return (
<div className="salaryItemForm">
<div className="btnBar">
<div className="btns">
<Button type="default" onClick={() => {setAddCategoryVisible(true)}}>新增分类</Button>
<Button type="default" style={{marginLeft: "10px"}} onClick={() => {this.handlePreview()}}>预览</Button>
<Button type="default" onClick={() => {setAddCategoryVisible(true)}} disabled={canEdit !== 'true'}>新增分类</Button>
<Button type="default" style={{marginLeft: "10px"}} onClick={() => {this.handlePreview()}} disabled={canEdit !== "true"}>预览</Button>
</div>
<div className="searchInputWrapper">
<WeaInputSearch style={{width: "150px"}} />
@ -120,7 +121,7 @@ export default class SalaryItemForm extends React.Component {
if(item.items) {
item.items.map(i => {i.key = i.id})
return (
<CanMoveItem dataSource={item.items} onDataSourceChange={(dataSource) => {this.handleItemDataSourceChange(dataSource, item)}} title={item.name} onGroupDelete={() => {this.handleGroupDelete(item)}} onTitleChange={(value) => {this.handleItemTitleChange(item, value)}} onChange={(dataSource) => {this.handleCanMoveItemChange(dataSource, item)}}/>
<CanMoveItem disabled={canEdit !== "true"} dataSource={item.items} onDataSourceChange={(dataSource) => {this.handleItemDataSourceChange(dataSource, item)}} title={item.name} onGroupDelete={() => {this.handleGroupDelete(item)}} onTitleChange={(value) => {this.handleItemTitleChange(item, value)}} onChange={(dataSource) => {this.handleCanMoveItemChange(dataSource, item)}}/>
)
}
return ""

View File

@ -1,151 +1,319 @@
import React from 'react'
import { Row, Col } from 'antd'
import { WeaSelect, WeaTextarea, WeaInput, WeaCheckbox } from "ecCom"
import "./index.less"
import TipLabel from '../../components/TipLabel'
import { daysOptions, cycleTypeOption } from './options'
import { inject, observer } from 'mobx-react';
import RequiredLabelTip from "../../components/requiredLabelTip"
import { getCurrentYearMonth, getCurrentMonth, getSubtractMonthYearMonth, getAddMonthYearMonth} from '../../util/date'
import React from "react";
import { Row, Col } from "antd";
import { toJS } from "mobx";
import { WeaSelect, WeaTextarea, WeaInput, WeaCheckbox } from "ecCom";
import "./index.less";
import TipLabel from "../../components/TipLabel";
import { daysOptions, cycleTypeOption } from "./options";
import { inject, observer } from "mobx-react";
import RequiredLabelTip from "../../components/requiredLabelTip";
import {
getCurrentYearMonth,
getCurrentMonth,
getSubtractMonthYearMonth,
getAddMonthYearMonth,
} from "../../util/date";
@inject('ledgerStore')
@inject("ledgerStore", "taxAgentStore")
@observer
export default class SlideBaseForm extends React.Component {
constructor(props) {
super(props)
this.state = {
name: "",
taxableItems: 1
}
constructor(props) {
super(props);
this.state = {
name: "",
taxableItems: 1,
};
}
componentWillMount() {
const { edit } = this.props;
const {
ledgerStore: { initBaseInfoRequest },
} = this.props;
if (edit) {
const {
ledgerStore: { getLedgerBasicForm },
} = this.props;
getLedgerBasicForm();
} else {
initBaseInfoRequest();
}
componentWillMount() {
const { edit } = this.props;
const { ledgerStore: {initBaseInfoRequest}} = this.props;
if(edit) {
const { ledgerStore: { getLedgerBasicForm }} = this.props;
getLedgerBasicForm()
} else {
initBaseInfoRequest();
}
}
handleChange(params) {
const {
ledgerStore: { baseInfoRequest, setBaseInfoRequest },
} = this.props;
let request = { ...baseInfoRequest };
Object.keys(params).map((key) => {
request[key] = params[key];
});
setBaseInfoRequest(request);
}
// 获取开始日期
getStartDate(salaryCycleType, day) {
day = Number(day);
return this.getMonth(salaryCycleType) + "-" + (day < 10 ? "0" + day : day);
}
// 获取开始月份
getMonth(salaryCycleType) {
switch (salaryCycleType) {
case "1": // 上上月
return getSubtractMonthYearMonth(2);
case "2": // 上月
return getSubtractMonthYearMonth(1);
case "3": // 本月
return getCurrentYearMonth();
case "4": // 下月
return getAddMonthYearMonth(1);
}
}
handleChange(params) {
const { ledgerStore: {baseInfoRequest, setBaseInfoRequest}} = this.props;
let request= {...baseInfoRequest}
Object.keys(params).map(key => {
request[key] = params[key]
})
setBaseInfoRequest(request)
}
render() {
const { request, ledgerStore, taxAgentStore, edit } = this.props;
const { baseInfoRequest } = ledgerStore;
const { taxAgentOption } = taxAgentStore;
const {
canEdit="true",
name,
taxAgentId,
taxableItems,
salaryCycleType,
salaryCycleFromDay,
taxCycleType,
attendCycleType,
attendCycleFromDay,
socialSecurityCycleType,
description,
} = baseInfoRequest;
return (
<div className="slideBaseForm">
<Row>
<Col span={18}>
<div className="leftContentWrapper">
<Row className="formItem">
<Col span={6}>
账套名称
<RequiredLabelTip />
</Col>
<Col span={18}>
<WeaInput
disabled={canEdit !== "true"}
style={{ width: "190px" }}
value={name}
onChange={(value) => {
this.handleChange({ name: value });
}}
/>
</Col>
</Row>
<Row className="formItem">
<Col span={6}>
个税扣缴义务人
<RequiredLabelTip />
</Col>
<Col span={18}>
<WeaSelect
disabled={canEdit !== "true" || edit}
showSearch // 设置select可搜索
style={{ width: 190 }}
options={taxAgentOption}
value={taxAgentId}
onChange={(v) => {
this.handleChange({ taxAgentId: v });
}}
/>
</Col>
</Row>
<Row className="formItem">
<Col span={6}>
薪资类型
<RequiredLabelTip />
</Col>
<Col span={18}>
<WeaSelect
disabled={canEdit !== "true"}
options={[
{
key: "1",
selected: true,
showname: "正常工资薪金所得",
},
]}
style={{ width: "190px" }}
value={taxableItems}
onChange={(value) => {
this.handleChange({ taxableItems: value });
}}
/>
</Col>
</Row>
<Row className="formItem">
<Col span={6}>
薪资周期
<RequiredLabelTip />
</Col>
<Col span={18}>
<WeaSelect
disabled={canEdit !== "true"}
options={cycleTypeOption}
style={{ width: "90px" }}
value={salaryCycleType}
onChange={(value) => {
this.handleChange({ salaryCycleType: value });
}}
/>
<WeaSelect
disabled={canEdit !== "true"}
options={daysOptions}
style={{ width: "90px", marginLeft: "10px" }}
value={salaryCycleFromDay}
onChange={(value) => {
this.handleChange({ salaryCycleFromDay: value });
}}
/>
<span style={{ marginLeft: "10px" }}>至本月最后一天</span>
</Col>
</Row>
<Row className="formItem">
<Col span={6}>
税款所属期
<RequiredLabelTip />
</Col>
<Col span={18}>
<WeaSelect
disabled={canEdit !== "true"}
options={cycleTypeOption}
style={{ width: "90px" }}
value={taxCycleType}
onChange={(value) => {
this.handleChange({ taxCycleType: value });
}}
/>
</Col>
</Row>
<Row className="formItem">
<Col span={6}>
考勤周期
<RequiredLabelTip />
</Col>
<Col span={18}>
<WeaSelect
disabled={canEdit !== "true"}
options={cycleTypeOption}
style={{ width: "90px" }}
value={attendCycleType}
onChange={(value) => {
this.handleChange({ attendCycleType: value });
}}
/>
<WeaSelect
disabled={canEdit !== "true"}
options={daysOptions}
style={{ width: "90px", marginLeft: "10px" }}
value={attendCycleFromDay}
onChange={(value) => {
this.handleChange({ attendCycleFromDay: value });
}}
/>
<span style={{ marginLeft: "10px" }}>至本月最后一天</span>
</Col>
</Row>
<Row className="formItem">
<Col span={6}>
福利台账月份
<RequiredLabelTip />
</Col>
<Col span={18}>
<WeaSelect
disabled={canEdit !== "true"}
options={cycleTypeOption}
style={{ width: "90px" }}
value={socialSecurityCycleType}
onChange={(value) => {
this.handleChange({ socialSecurityCycleType: value });
}}
/>
</Col>
</Row>
// 获取开始日期
getStartDate(salaryCycleType, day) {
day = Number(day)
return this.getMonth(salaryCycleType) + "-" + (day < 10 ? "0" + day : day)
}
// 获取开始月份
getMonth(salaryCycleType) {
switch(salaryCycleType) {
case "1": // 上上月
return getSubtractMonthYearMonth(2)
case "2": // 上月
return getSubtractMonthYearMonth(1)
case "3": // 本月
return getCurrentYearMonth()
case "4": // 下月
return getAddMonthYearMonth(1)
}
}
render() {
const { request, ledgerStore } = this.props;
const { baseInfoRequest } = ledgerStore;
const { name, taxableItems, salaryCycleType, salaryCycleFromDay,
taxCycleType, attendCycleType, attendCycleFromDay, socialSecurityCycleType,
description} = baseInfoRequest
return (
<div className="slideBaseForm">
<Row>
<Col span={18}>
<div className="leftContentWrapper">
<Row className="formItem">
<Col span={6}>账套名称<RequiredLabelTip /></Col>
<Col span={18}>
<WeaInput style={{width: "190px"}} value={name} onChange={(value) => {this.handleChange({name: value})}}/>
</Col>
</Row>
<Row className="formItem">
<Col span={6}>薪资类型<RequiredLabelTip /></Col>
<Col span={18}>
<WeaSelect options={[{
key: "1",
selected: true,
showname: "正常工资薪金所得"
}]} style={{width: "190px"}} value={taxableItems} onChange={(value) => {this.handleChange({taxableItems: value})}}/>
</Col>
</Row>
<Row className="formItem">
<Col span={6}>薪资周期<RequiredLabelTip /></Col>
<Col span={18}>
<WeaSelect options={cycleTypeOption} style={{width: "90px"}} value={salaryCycleType} onChange={(value) => {this.handleChange({salaryCycleType: value})}}/>
<WeaSelect options={daysOptions} style={{width: "90px", marginLeft: '10px'}} value={salaryCycleFromDay} onChange={(value) => {this.handleChange({salaryCycleFromDay: value})}}/>
<span style={{marginLeft: "10px"}}>至本月最后一天</span>
</Col>
</Row>
<Row className="formItem">
<Col span={6}>税款所属期<RequiredLabelTip /></Col>
<Col span={18}>
<WeaSelect options={cycleTypeOption} style={{width: "90px"}} value={taxCycleType} onChange={(value) => {this.handleChange({taxCycleType: value})}}/>
</Col>
</Row>
<Row className="formItem">
<Col span={6}>考勤周期<RequiredLabelTip /></Col>
<Col span={18}>
<WeaSelect options={cycleTypeOption} style={{width: "90px"}} value={attendCycleType} onChange={(value) => {this.handleChange({attendCycleType: value})}}/>
<WeaSelect options={daysOptions} style={{width: "90px", marginLeft: "10px"}} value={attendCycleFromDay} onChange={(value) => {this.handleChange({attendCycleFromDay: value})}}/>
<span style={{marginLeft: "10px"}}>至本月最后一天</span>
</Col>
</Row>
<Row className="formItem">
<Col span={6}>福利台账月份<RequiredLabelTip /></Col>
<Col span={18}>
<WeaSelect options={cycleTypeOption} style={{width: "90px"}} value={socialSecurityCycleType} onChange={(value) => {this.handleChange({socialSecurityCycleType: value})}}/>
</Col>
</Row>
<Row className="formItem">
<Col span={6}>核算人员范围<RequiredLabelTip /></Col>
<Col span={18}>
<WeaCheckbox value={true} viewAttr={1} content="【入职日期≤薪资周期止】且【离职日期≥薪资周期起】" />
</Col>
</Row>
<Row className="formItem">
<Col span={6}>备注</Col>
<Col span={18}>
<WeaTextarea style={{width: "190px"}} value={description} onChange={(value) => {this.handleChange({description: value})}} />
</Col>
</Row>
</div>
</Col>
<Col span={6}>
<div className="rightContentWrapper">
<TipLabel title="月份周期说明">
<p className="greytip">薪资所属月是<span className="higelinered">{getCurrentYearMonth()}</span><span className="higelinered">{getCurrentMonth()}</span></p>
<p className="greytip">根据您当前的选择相应的周期为</p>
<div className="tipLabel">薪资周期</div>
<p className="greytip"><span className="higelinered">{this.getStartDate(salaryCycleType, salaryCycleFromDay)}</span><span className="higelinered">{this.getMonth(salaryCycleType)}-30</span></p>
<div className="tipLabel">税款所属期</div>
<p className="greytip higelinered">{this.getMonth(taxCycleType)}</p>
<div className="tipLabel">考勤取值周期</div>
<p className="greytip"><span className="higelinered">{this.getStartDate(attendCycleType, attendCycleFromDay)}</span><span className="higelinered">{this.getMonth(attendCycleType)}-30</span></p>
<div className="tipLabel">福利台账月份</div>
<p className="greytip">引用<span className="higelinered">{this.getMonth(socialSecurityCycleType)}</span></p>
</TipLabel>
</div>
</Col>
</Row>
<Row className="formItem">
<Col span={6}>
核算人员范围
<RequiredLabelTip />
</Col>
<Col span={18}>
<WeaCheckbox
value={true}
viewAttr={1}
content="【入职日期≤薪资周期止】且【离职日期≥薪资周期起】"
/>
</Col>
</Row>
<Row className="formItem">
<Col span={6}>备注</Col>
<Col span={18}>
<WeaTextarea
disabled={canEdit !== "true"}
style={{ width: "190px" }}
value={description}
onChange={(value) => {
this.handleChange({ description: value });
}}
/>
</Col>
</Row>
</div>
)
}
}
</Col>
<Col span={6}>
<div className="rightContentWrapper">
<TipLabel title="月份周期说明">
<p className="greytip">
薪资所属月是
<span className="higelinered">{getCurrentYearMonth()}</span>
即核算员工
<span className="higelinered">{getCurrentMonth()}</span>
月的工资
</p>
<p className="greytip">根据您当前的选择相应的周期为</p>
<div className="tipLabel">薪资周期</div>
<p className="greytip">
<span className="higelinered">
{this.getStartDate(salaryCycleType, salaryCycleFromDay)}
</span>
<span className="higelinered">
{this.getMonth(salaryCycleType)}-30
</span>
</p>
<div className="tipLabel">税款所属期</div>
<p className="greytip higelinered">
{this.getMonth(taxCycleType)}
</p>
<div className="tipLabel">考勤取值周期</div>
<p className="greytip">
<span className="higelinered">
{this.getStartDate(attendCycleType, attendCycleFromDay)}
</span>
<span className="higelinered">
{this.getMonth(attendCycleType)}-30
</span>
</p>
<div className="tipLabel">福利台账月份</div>
<p className="greytip">
引用
<span className="higelinered">
{this.getMonth(socialSecurityCycleType)}
</span>
的福利台账数据
</p>
</TipLabel>
</div>
</Col>
</Row>
</div>
);
}
}

View File

@ -56,7 +56,8 @@ export default class SlideRefereUser extends React.Component {
}
render() {
const { ledgerStore: {includeType, userTableStore, addUserModalVisible, setAddUserModalVisible}} = this.props;
const { ledgerStore: {includeType, userTableStore, addUserModalVisible, setAddUserModalVisible, baseInfoRequest}} = this.props;
const { canEdit="true" } = baseInfoRequest;
let { columns, list} = userTableStore
const { selectedRowKeys } = this.state
columns = columns || []
@ -74,10 +75,13 @@ export default class SlideRefereUser extends React.Component {
<div className="refereUserHeader">
<div className="headerLeft"><span className={includeType == 1 ? "selectedCrumbs" : "tabItem"} onClick={() => {this.handleTabClick(1)}}>关联人员范围</span> {' '} | {' '} <span className={includeType == 0 ? "selectedCrumbs" : "tabItem"} onClick={() => {this.handleTabClick(0)}}></span></div>
<WeaInputSearch className="searchInput" value={this.state.searchValue} onChange={(value) => {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/>
<div className="headerIcon">
{
canEdit === 'true' &&
<div className="headerIcon">
<Icon className="iconItem" type="minus-square" onClick={() => {this.handleTabDelete()}}/>
<Icon className="iconItem" type="plus-square" onClick={() => {setAddUserModalVisible(true)}}/>
</div>
</div>
}
</div>
<div>
<Table rowSelection={rowSelection} dataSource={list} columns={columns} pagination={{

View File

@ -1,4 +1,4 @@
import React from 'react'
import React,{ Fragment } from 'react'
import { Icon, Table, message, Modal } from 'antd'
import { WeaTable } from 'ecCom'
import { slideStep3Columns } from '../columns'
@ -127,7 +127,7 @@ export default class CanMoveItem extends React.Component {
}
render() {
const {ledgerStore: {setAddItemVisible, addItemVisible}} = this.props;
const {disabled, ledgerStore: {setAddItemVisible, addItemVisible}} = this.props;
const { selectedRowKeys, formalModalVisible, addCategoryVisible } = this.state;
const rowSelection = {
selectedRowKeys,
@ -143,15 +143,25 @@ export default class CanMoveItem extends React.Component {
<span className="itemTitle">{this.props.title}
{
this.props.title !== "未分类" && <span>
<i className="icon-coms-edit" style={{marginLeft: "10px", marginRight: "10px", cursor:"pointer"}} onClick={() => {this.handleEditGroupIconClick(this.props.title)}}/>
<i className="icon-coms-Delete" style={{cursor:"pointer"}} onClick={() => {this.handleDeleteGroupIconClick()}}/>
{
!disabled &&
<Fragment>
<i className="icon-coms-edit" style={{marginLeft: "10px", marginRight: "10px", cursor:"pointer"}} onClick={() => {this.handleEditGroupIconClick(this.props.title)}}/>
<i className="icon-coms-Delete" style={{cursor:"pointer"}} onClick={() => {this.handleDeleteGroupIconClick()}}/>
</Fragment>
}
</span>
}
</span>
<span className="rightBtnsWrapper">
<Icon className="iconItem" type="minus-square" onClick={() => {this.handleDelete()}}/>
<Icon className="iconItem" type="plus-square" onClick={() => { this.setState({addItemVisible: true}) }}/>
{
!disabled &&
<Fragment>
<Icon className="iconItem" type="minus-square" onClick={() => {this.handleDelete()}}/>
<Icon className="iconItem" type="plus-square" onClick={() => { this.setState({addItemVisible: true}) }}/>
</Fragment>
}
<Icon type={this.state.showContent ? "down" : 'left'} style={{cursor: "pointer"}} onClick={() => {this.handleTiggleContent()}}/>
</span>
</div>

View File

@ -0,0 +1,144 @@
import React from "react";
import { Modal, Button, Row, Col, Radio, Checkbox } from "antd";
import { WeaSelect, WeaBrowser } from "ecCom";
import { inject, observer } from "mobx-react";
import RequiredLabelTip from "../../components/requiredLabelTip";
const CheckboxGroup = Checkbox.Group;
export default class AddTaxAgentModal extends React.Component {
constructor(props) {
super(props);
this.state = {
selectedKey: "EMPLOYEE",
checkboxValue: [],
ids: "",
};
}
onCheckboxChange = (checkboxValue) => {
this.setState({ checkboxValue });
};
// 保存
handleSave = () => {
const { onTaxAgentSave } = this.props;
const { checkboxValue, ids, selectedKey } = this.state;
const payload = {
employeeStatus: checkboxValue,
targetParams: _.map(ids.split(","), (it) => ({
targetType: selectedKey,
targetId: it,
})),
};
onTaxAgentSave && onTaxAgentSave(payload);
};
// 重置
handleReset = () => {
this.setState({
selectedKey: "EMPLOYEE",
checkboxValue: [],
ids: "",
});
};
render() {
const { employeeStatus, targetTypeList, visible, onCancel, loading } =
this.props;
return (
<Modal
visible={visible}
onCancel={onCancel}
width={600}
title="关联人员"
footer={
<div style={{ display: "inlne-block" }}>
<Button type="primary" laoding={loading} onClick={this.handleSave}>
保存
</Button>
<Button type="default" onClick={this.handleReset}>
重置
</Button>
</div>
}>
<div style={{ padding: "20px" }}>
<Row style={{ lineHeight: "40px" }}>
<Col span={8}>
对象类型
<RequiredLabelTip />
</Col>
<Col span={16}>
<div style={{ display: "inline-block", verticalAlign: "top" }}>
<WeaSelect
style={{ height: "30px", marginRight: "10px" }}
options={_.map(targetTypeList, (it) => ({
...it,
key: it.id,
showname: it.name,
selected: false,
}))}
value={this.state.selectedKey}
onChange={(value) => {
this.setState({ selectedKey: value, ids: "" });
}}
/>
</div>
<div style={{ display: "inline-block", verticalAlign: "middle" }}>
{this.state.selectedKey == "EMPLOYEE" && (
<WeaBrowser
type={17}
title={"人员选择"}
isSingle={false}
inputStyle={{ width: 200 }}
onChange={(ids, names, datas) => {
this.setState({ ids });
}}
/>
)}
{this.state.selectedKey == "DEPT" && (
<WeaBrowser
type={57}
title={"部门选择"}
isSingle={false}
inputStyle={{ width: 200 }}
onChange={(ids, names, datas) => {
this.setState({ ids });
}}
/>
)}
{this.state.selectedKey == "POSITION" && (
<WeaBrowser
type={278}
title={"岗位选择"}
isSingle={false}
inputStyle={{ width: 200 }}
onChange={(ids, names, datas) => {
this.setState({ ids });
}}
/>
)}
</div>
</Col>
</Row>
<Row style={{ lineHeight: "40px" }}>
<Col span={8}>
选择员工状态
<RequiredLabelTip />
</Col>
<Col span={16}>
<CheckboxGroup
options={_.map(employeeStatus, (it) => ({
label: it.name,
value: it.id,
}))}
value={this.state.checkboxValue}
onChange={(e) => this.onCheckboxChange(e)}
/>
</Col>
</Row>
</div>
</Modal>
);
}
}

View File

@ -0,0 +1,65 @@
/*
* Author: 黎永顺
* Description: 表单渲染condition
* Date: 2022-05-30 22:39:03
* LastEditTime: 2022-05-31 20:34:07
*/
export const editConditions = [
{
items: [
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["name"],
fieldcol: 14,
rules: "required|string",
label: "名称",
labelcol: 6,
value: "",
viewAttr: 3,
},
{
browserConditionParam: {
completeParams: {},
conditionDataParams: {},
dataParams: {},
destDataParams: {},
hasAddBtn: false,
hasAdvanceSerach: true,
idSeparator: ",",
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: false,
linkUrl: "/hrm/resource/HrmResource.jsp?id=",
pageSize: 10,
quickSearchName: "",
replaceDatas: [],
title: "人力资源",
type: "1",
viewAttr: 3,
rules: "required",
},
colSpan: 1,
conditionType: "BROWSER",
rules: "required|string",
domkey: ["adminUserIds"],
fieldcol: 14,
label: "管理员",
labelcol: 6,
viewAttr: 3,
},
{
colSpan: 1,
conditionType: "TEXTAREA",
domkey: ["description"],
fieldcol: 14,
label: "备注",
labelcol: 6,
value: "",
viewAttr: 2,
},
],
defaultshow: true,
},
];

View File

@ -1,82 +1,179 @@
import React from 'react'
import { Button, Modal, Row, Col, message } from 'antd';
import { WeaTextarea, WeaInput } from "ecCom";
import { logColumns, dataSource } from "../../common/columns"
import RequiredLabelTip from "../../components/requiredLabelTip"
import React from "react";
import { Button, Row, Col, message } from "antd";
import {
WeaDialog,
WeaFormItem,
WeaSearchGroup,
WeaSteps,
WeaTab,
} from "ecCom";
import { WeaSwitch } from "comsMobx";
import PersonalScope from "./personalScope";
const titleOuter = {
display: "flex",
justifyContent: "space-between",
alignItems: "center",
};
const left = {
display: "flex",
flexDirection: "column",
};
const stepWrapper = {
padding: "20px 200px",
};
const Step = WeaSteps.Step;
export default class EditModal extends React.Component {
constructor(props) {
super(props)
this.state = {
name: "",
remark: ""
constructor(props) {
super(props);
this.state = {
date: "",
};
}
handleSubmit = () => {
const { onSubmit, btnType, onPrev } = this.props;
const { form } = this.props.taxAgentStore;
if (btnType === "prev") {
onPrev && onPrev();
return;
}
form.validateForm().then((f) => {
if (f.isValid) {
const formData = form.getFormParams();
const { adminUserIds, ...extraVal } = formData;
onSubmit &&
onSubmit({ adminUserIds: adminUserIds.split(","), ...extraVal });
} else {
f.showErrors();
this.setState({ date: new Date() }); // 改变一个state的变量,强制页面刷新
}
});
};
renderEditForm = () => {
const { editConditions } = this.props;
const { form } = this.props.taxAgentStore;
const { isFormInit } = form;
let group = [];
isFormInit &&
editConditions.map((c, index) => {
let items = [];
c.items.map((field, idx) => {
items.push({
com: (
<WeaFormItem
ecId={`tasAgent_WeaFormItem@jsxoq6@${index}@${idx}`}
label={`${field.label}`}
labelCol={{ span: `${field.labelcol}` }}
error={form.getError(field)}
tipPosition="bottom"
wrapperCol={{ span: `${field.fieldcol}` }}>
<WeaSwitch
ecId={`tasAgent_WeaSwitch@r2lhga@${index}@${idx}`}
fieldConfig={field}
form={form}
/>
</WeaFormItem>
),
col: 1,
hide: form.isHide(field, (keys, allParams) => {
return false;
}),
});
});
group.push(
<WeaSearchGroup
ecId={`tasAgent_WeaSearchGroup@3y8h9i@${index}`}
needTigger={false}
title={c.title}
showGroup={c.defaultshow}
items={items}
/>
);
});
return group;
};
render() {
const { date } = this.state;
const {
visible,
title,
current,
btnType,
editType,
editId,
saveloading,
onClose,
onChangeTab,
taxAgentStore,
editConditions,
} = this.props;
const { form } = taxAgentStore;
return (
<WeaDialog
onCancel={() => {
form.resetForm();
onClose && onClose();
}}
title={
<div style={titleOuter}>
<div style={left}>
<div className="title">{title}</div>
</div>
<div className="right">
{editType !== "set" && (
<Button
type="primary"
onClick={this.handleSubmit}
loading={saveloading}>
{btnType === "save"
? "保存并进入下一步"
: btnType === "prev"
? "上一步"
: "保存"}
</Button>
)}
</div>
</div>
}
}
componentWillMount() { // 初始化渲染页面
this.setState({
name: this.props.name,
remark: this.props.remark
})
}
validate() {
if(this.state.name == "") {
message.warning("个税扣缴义务人名称不能为空");
return false;
}
return true;
}
submitAdd() {
if(this.validate()) {
this.props.onSubmitAdd({name: this.state.name, description: this.state.remark})
}
}
submitUpdate() {
if(this.validate) {
this.props.onSubmitUpdate({id: this.props.currentId, name: this.state.name, description: this.state.remark})
}
}
render() {
return (
<Modal title={this.props.title} visible={this.props.visible}
onOk={() => {
this.props.operate == "add" ? this.submitAdd() : this.submitUpdate();
}} onCancel={this.props.onCancel}
>
<Row gutter={16}>
<Col span={6}>
<div className="formLabel">名称:<RequiredLabelTip /></div>
</Col>
<Col span={18}>
<WeaInput
id="name"
value={this.state.name}
onChange={(v) => {this.setState({
name: v
})}}
/>
</Col>
</Row>
<Row gutter={16} style={{ marginTop: "16px" }}>
<Col span={6}>
<div className="formLabel">备注:</div>
</Col>
<Col span={18}>
<WeaTextarea value={this.state.remark} onChange={
(v) => {
this.setState({
remark: v
})
}
} />
</Col>
</Row>
</Modal>
)
}
visible={visible}
style={{ width: 800, minHeight: 350 }}
hasScroll>
{title.indexOf("编辑") >= 0 && (
<WeaTab
datas={[
{
title: "基础设置",
viewcondition: 0,
},
{
title: "人员范围",
viewcondition: 1,
},
]}
keyParam="viewcondition" //主键
selectedKey={current}
onChange={(v) => onChangeTab && onChangeTab(v)}
/>
)}
{(btnType === "save" || title.indexOf("编辑") < 0) && (
<div style={stepWrapper}>
<WeaSteps current={current} size="small">
<Step description="基础设置" />
<Step description="人员范围" />
</WeaSteps>
</div>
)}
{current == 0 ? (
this.renderEditForm()
) : (
<PersonalScope taxAgentId={editId} />
)}
</WeaDialog>
);
}
}

View File

@ -1,225 +1,451 @@
import React from 'react';
import { inject, observer } from 'mobx-react';
import { toJS } from 'mobx';
import React from "react";
import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
import { Row, Col, Switch, message, Modal, Menu, Dropdown } from "antd";
import {
WeaTop,
WeaRightMenu,
WeaSearchGroup,
WeaFormItem,
WeaTable,
} from "ecCom";
import { renderNoright } from "../../util"; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import EditModal from "./editModal";
import TipLabel from "../../components/TipLabel";
import { editConditions } from "./editConditions";
import "./index.less";
import { Button, Table, DatePicker, Row, Col, Modal, Form, Input } from 'antd';
const { TextArea } = Input;
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaInputSearch, WeaInput, WeaTextarea } from 'ecCom';
import { WeaTableNew } from 'comsMobx';
const WeaTable = WeaTableNew.WeaTable;
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'
import LogViewModal from '../../components/logViewModal';
import EditModal from './editModal'
import TipLabel from '../../components/TipLabel'
const { MonthPicker } = DatePicker;
@inject('taxAgentStore')
@inject("taxAgentStore")
@observer
export default class TaxAgent extends React.Component {
constructor(props) {
super(props);
this.state = {
value: "",
selectedKey: "0",
searchValue: "",
logViewVisiable: false,
modalVisiable: false,
remarkValue: "",
nameValue: "",
title: "新增个税扣缴义务人",
currentOperate: "add",
currentId: "",
}
editModalProps: {
title: "新增个税扣缴义务人",
visible: false,
current: 0,
btnType: "save", //save: 添加, edit: 编辑, prev: '上一步'
editId: "",
editType: "save",
},
editModalLoading: {
saveloading: false,
},
devolutionStatus: 0,
conditions: editConditions,
permission: {},
};
}
componentWillMount() { // 初始化渲染页面
const { taxAgentStore: { doInit } } = this.props;
componentWillMount() {
const { taxAgentStore } = this.props;
const { doInit } = taxAgentStore;
doInit();
this.getPermission();
}
showLogView = () => {
this.setState({logViewVisiable: true})
}
onEdit = (record) => {
this.setState({
remarkValue: record.description,
nameValue: record.name,
title: "编辑个税扣缴义务人",
currentOperate: "update",
currentId: record.id
})
const {taxAgentStore : { setModalVisiable }} = this.props
setModalVisiable(true)
}
// 增加编辑功能重写columns绑定事件
getColumns = (columns) => {
let newColumns = '';
newColumns = columns.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) {
case "name":
return <a onClick={() => {this.onEdit(record)}}
dangerouslySetInnerHTML={{ __html: valueSpan }} />
case "operate":
return <a onClick={() => {this.onEdit(record)}}>编辑</a>
default:
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />
}
}
return newColumn;
});
return newColumns;
}
onOperatesClick = (record, index, operate, flag) => {
const {taxAgentStore : {doDelete}} = this.props;
switch(operate.index.toString()){
case '0': // 删除
Modal.confirm({
title: "信息确认",
content: "确认删除吗?",
onOk() {
doDelete([record.id])
},
onCancel() {}
getPermission = () => {
const { getPermission } = this.props.taxAgentStore;
getPermission().then(({ status, data }) => {
if (status) {
this.setState({ permission: data }, () => {
this.getTaxAgentBaseForm();
});
}
});
};
getTaxAgentBaseForm = () => {
const { taxAgentStore } = this.props;
const { getTaxAgentBaseForm } = taxAgentStore;
getTaxAgentBaseForm().then(({ status, data }) => {
if (status && !_.isEmpty(data)) {
const { devolutionStatus } = data;
this.setState({ devolutionStatus });
}
});
};
taxAgentBaseSave = (devolutionStatus) => {
Modal.confirm({
title: "信息确认",
content: `确认${!devolutionStatus ? "停用" : "启用"}分权?`,
onOk: () => {
const paylaod = { devolutionStatus };
const { taxAgentStore } = this.props;
const { taxAgentBaseSave, doInit, pageObj } = taxAgentStore;
taxAgentBaseSave(paylaod).then(({ status, errormsg }) => {
if (status) {
message.success(`${!devolutionStatus ? "停用" : "启用"}分权成功`);
this.getTaxAgentBaseForm();
doInit({ current: pageObj.current, pageSize: pageObj.pageSize });
} else {
message.error(
errormsg || `${!devolutionStatus ? "停用" : "启用"}分权失败`
);
}
});
},
onCancel() {},
});
};
getTaxAgentForm = (id, current) => {
const { conditions } = this.state;
const { taxAgentStore } = this.props;
const { getTaxAgentForm, getCondition } = taxAgentStore;
getTaxAgentForm({ id }).then(({ status, data }) => {
if (status && !_.isEmpty(data)) {
const [conditionItem] = conditions;
const conditionMap = _.map(conditionItem.items, (it) => {
const key = it.domkey.join("");
if (it.conditionType === "BROWSER") {
return {
...it,
browserConditionParam: {
...it.browserConditionParam,
replaceDatas: _.map(data[key], (b) => ({
id: b.id,
name: b.content,
})),
},
viewAttr: current == 1 ? 1 : it.viewAttr,
};
} else {
if (data[key]) {
return {
...it,
value: data[key],
viewAttr: current == 1 ? 1 : it.viewAttr,
};
}
}
return { ...it, viewAttr: current == 1 ? 1 : it.viewAttr };
});
this.setState(
{
conditions: [{ defaultshow: true, items: conditionMap }],
},
() => {
getCondition(this.state.conditions);
}
);
}
});
};
showEditModal = (editId, current) => {
this.setState(
{
editModalProps: {
...this.state.editModalProps,
visible: true,
title: editId ? "编辑个税扣缴义务人" : "新增个税扣缴义务人",
btnType: editId ? "edit" : "save",
editId: editId,
editType: current ? "set" : editId && !current ? "edit" : "save",
current: current ? current : 0,
},
},
() => {
editId && this.getTaxAgentForm(editId, current);
}
);
};
closeModal = () => {
const { taxAgentStore } = this.props;
const { form, getCondition } = taxAgentStore;
this.setState(
{
editModalProps: {
...this.state.editModalProps,
title: "新增个税扣缴义务人",
current: 0,
btnType: "save",
editId: "",
editType: "save",
visible: false,
},
conditions: editConditions,
},
() => {
form.resetForm();
getCondition(this.state.conditions);
}
);
};
/**
* name:表单提交
* return {*}
*/
handleSubmit = (module) => {
const { taxAgentStore } = this.props;
const { editModalProps } = this.state;
const { doInit, saveTaxAgent, updateTaxAgent, pageObj } = taxAgentStore;
const { btnType, editId, editType } = editModalProps;
if (btnType === "save") {
// 新增
this.setState({
editModalLoading: {
saveloading: true,
},
});
const payload = { ...module };
saveTaxAgent(payload).then(({ status, errormsg, data }) => {
this.setState({
editModalLoading: {
saveloading: false,
},
});
if (status) {
message.success("新增成功");
this.setState({
editModalProps: {
...editModalProps,
editId: data,
current: 1,
btnType: "prev",
},
});
doInit({ current: pageObj.current, pageSize: pageObj.pageSize });
} else {
message.error(errormsg || "新增失败");
}
});
} else if (btnType === "edit") {
// 编辑
this.setState({
editModalLoading: {
saveloading: true,
},
});
const payload = { ...module, id: editId };
updateTaxAgent(payload).then(({ status, errormsg }) => {
this.setState({
editModalLoading: {
saveloading: false,
},
});
if (status) {
message.success("更新成功");
if (editType === "edit") {
this.closeModal();
} else {
this.setState({
editModalProps: {
...editModalProps,
current: 1,
btnType: "prev",
},
});
}
doInit({ current: pageObj.current, pageSize: pageObj.pageSize });
} else {
message.error(errormsg || "更新失败");
}
});
}
};
/**
* name: 删除个税扣缴义务人
* param {*} agentId
* return {*}
*/
deleteTaxAgent = (agentId) => {
const { taxAgentStore } = this.props;
const { deleteTaxAgent, pageObj, doInit } = taxAgentStore;
Modal.confirm({
title: "信息确认",
content: `确认要删除吗?`,
onOk: () => {
deleteTaxAgent([agentId]).then(({ status, errormsg }) => {
if (status) {
message.success("删除成功");
doInit({ current: pageObj.current, pageSize: pageObj.pageSize });
} else {
message.error(errormsg || "删除失败");
}
});
},
});
};
render() {
const { taxAgentStore } = this.props;
const { loading, hasRight, form, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd, doInsert } = taxAgentStore;
const { modalVisiable, setModalVisiable, doUpdate } = taxAgentStore;
const {
editModalProps,
editModalLoading,
devolutionStatus,
conditions,
permission,
} = this.state;
const { loading, pageObj, dataSource, columns, doInit, hasRight } =
taxAgentStore;
const topTab = [
];
if (!hasRight && !loading) { // 无权限处理
if (!hasRight && !loading) {
// 无权限处理
return renderNoright();
}
const rightMenu = [// 右键菜单
// {
// key: 'BTN_COLUMN',
// icon: <i className='icon-coms-Custom' />,
// content: '操作日志',
// onClick: this.showLogView
// },
];
const initEditModal = () => {
this.setState({
nameValue: '',
remarkValue: "",
title: "新增个税扣缴义务人",
currentOperate: "add"
})
}
const showEditModal = () => {
initEditModal();
setModalVisiable(true)
}
const renderSearchOperationItem = () => {
return <div>
<Button type="primary" onClick={() => { showEditModal() }}>新增</Button>
{' '}
<WeaInputSearch
value={this.state.searchValue}
placeholder={'请输入个税扣缴义务人名称'}
onSearch={(name) => doSearch(name)}
/>
</div>
}
const renderTipsLabel = () => {
const tipList = [
"1、个税扣缴义务人与档案中的个税扣缴义务人匹配修改个税扣缴义务人名称薪资档案的个税扣缴义务人数据同步更新",
"2、删除个税扣缴义务人需先确认档案里无人员使用该个税扣缴义务人否则不予删除"
]
return (
<TipLabel
tipList={tipList}
/>
)
}
"2、删除个税扣缴义务人需先确认档案里无人员使用该个税扣缴义务人否则不予删除",
];
return <TipLabel tipList={tipList} />;
};
const pagination = {
total: pageObj.total,
showTotal: (total) => `${total}`,
showSizeChanger: true,
onShowSizeChange(current, pageSize) {
doInit({ current, pageSize });
},
onChange(current) {
doInit({ current, pageSize: pageObj.pageSize });
},
};
const newColumns = _.map(
[
...columns,
{
title: "操作",
key: "operation",
render: (text, record) => (
<div className="operationWapper">
<a
href="javaScript:void(0);"
onClick={() => this.showEditModal(record.id)}>
编辑
</a>
<Dropdown
overlay={
<Menu>
<Menu.Item key="0">
<a
href="javaScript:void(0);"
onClick={() => this.deleteTaxAgent(record.id)}>
删除
</a>
</Menu.Item>
</Menu>
}>
<a className="ant-dropdown-link" href="javaScript:void(0);">
<i className="icon-coms-more" />
</a>
</Dropdown>
</div>
),
},
],
(item) => {
if (item.dataIndex === "employeeRange") {
return {
...item,
render: (text, record) => {
return (
<div className="employeeRangeWapper">
<a
href="javaScript:void(0);"
onClick={() => this.showEditModal(record.id, 1)}>
{text}
</a>
</div>
);
},
};
} else {
return { ...item };
}
}
);
return (
<div className="mySalaryBenefitsWrapper">
<WeaRightMenu
datas={rightMenu} // 右键菜单
>
<WeaRightMenu>
<WeaTop
title="个税扣缴义务人" // 文字
icon={<i className='icon-coms-meeting' />} // 左侧图标
iconBgcolor='#F14A2D' // 左侧图标背景色
icon={<i className="icon-coms-meeting" />} // 左侧图标
iconBgcolor="#F14A2D" // 左侧图标背景色
showDropIcon={true} // 是否显示下拉按钮
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
>
<CustomTab topTab={topTab}
searchOperationItem={
renderSearchOperationItem()
}
onChange={(v) => {
this.setState({ selectedKey: v })
}}
/>
<Row gutter={16} style={{overflow: "hidden", width: "100%"}}>
<Row
gutter={16}
style={{ overflow: "hidden", width: "100%", marginTop: 8 }}>
<Col sm={24} md={24} lg={18} xl={18}>
<WeaTable // table内部做了loading加载处理页面就不需要再加了
comsWeaTableStore={tableStore} // table store
hasOrder={true} // 是否启用排序
needScroll={true} // 是否启用table内部列表滚动将自适应到父级高度
getColumns={this.getColumns}
onOperatesClick={this.onOperatesClick.bind(this)}
/>
<div className="mySalaryTableWrapper">
{permission.isChief && (
<WeaSearchGroup title={"基础信息"} showGroup>
<WeaFormItem
label="启用分权"
labelCol={{ span: 4 }}
wrapperCol={{ span: 20 }}>
<Switch
checked={devolutionStatus === 1}
onChange={this.taxAgentBaseSave}
/>
</WeaFormItem>
</WeaSearchGroup>
)}
<WeaSearchGroup
title={
<div className="titleWrapper">
<div className="title">个税扣缴义务人</div>
<i
className="icon-coms-Add-to"
title="新增"
onClick={() => this.showEditModal()}
/>
</div>
}
showGroup>
<WeaTable
columns={newColumns}
dataSource={dataSource}
pagination={pagination}
loading={loading}
/>
</WeaSearchGroup>
</div>
</Col>
<Col sm={24} md={24} lg={6} xl={6}>
{renderTipsLabel()}
</Col>
</Row>
</WeaTop>
</WeaRightMenu>
{
modalVisiable && <EditModal
title={this.state.title}
visible={modalVisiable}
name={this.state.nameValue}
remark={this.state.remarkValue}
onCancel={() => {setModalVisiable(false)}}
onSubmitAdd={(params) => {doInsert(params)}}
operate={this.state.currentOperate}
onSubmitUpdate={(params) => {doUpdate(params)}}
currentId={this.state.currentId}
/>
}
<LogViewModal
visible={this.state.logViewVisiable}
onCancel={() => {this.setState({logViewVisiable: false})}}
/>
{editModalProps.visible && (
<EditModal
{...editModalProps}
{...editModalLoading}
editConditions={conditions}
taxAgentStore={taxAgentStore}
onPrev={() =>
this.setState({
editModalProps: {
...editModalProps,
current: 0,
btnType: "edit",
},
})
}
onChangeTab={(current) => {
this.setState({
editModalProps: {
...editModalProps,
current,
},
});
}}
onClose={this.closeModal}
onSubmit={this.handleSubmit}
/>
)}
</div>
)
);
}
}

View File

@ -1,21 +1,81 @@
.logViewModal {
.searchBar {
.mySalaryBenefitsWrapper {
height: 100%;
.wea-new-top-wapper {
height: 100%;
}
.mySalaryTableWrapper {
.wea-search-group {
padding: 0;
.wea-content {
padding-left: 16px;
.ant-switch {
margin-top: 5px;
}
}
.titleWrapper {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
i {
color: #2db7f5;
font-size: 18px;
}
}
}
.searchBarLabel {
margin-bottom: 10px;
.ant-table-row:hover {
a.ant-dropdown-link {
display: inline-block;
}
}
.searchBarItem {
position: relative;
width: 200px;
margin-left: 10px;
margin-right: 10px;
}
.searchDateRange {
width: 300px;
}
.searchBtn {
position: absolute;
bottom: 0px;
.operationWapper,
.employeeRangeWapper {
a {
color: #4d7ad8;
}
a:hover {
text-decoration: none;
}
a.ant-dropdown-link {
margin-left: 18px;
display: none;
}
}
}
}
.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;
}
}

View File

@ -0,0 +1,218 @@
/*
* Author: 黎永顺
* Description: 个税扣缴义务人-人员范围
* Date: 2022-05-31 09:51:59
* LastEditTime: 2022-06-01 17:57:42
*/
import React, { Component } from "react";
import { message, Modal } from "antd";
import { inject, observer } from "mobx-react";
import SlideTaxagentUser from "./slideTaxagentUser";
import "./index.less";
const personScopeWarrper = {
padding: "0 25px",
};
@inject("taxAgentStore", "ledgerStore")
@observer
export default class PersonalScope extends Component {
constructor() {
super();
this.state = {
queryLoading: false,
submitLoading: false,
targetTypeList: [],
employeeStatus: [],
dataSource: [],
columns: [],
pageObj: {
current: 1,
pageSize: 10,
total: 0,
},
};
}
componentDidMount() {
this.getTaxAgentRangeForm();
this.getTaxAgentRangeListInclude();
}
getTaxAgentRangeForm = () => {
const { getTaxAgentRangeForm } = this.props.taxAgentStore;
getTaxAgentRangeForm().then(({ status, data }) => {
if (status) {
const { employeeStatus, targetTypeList } = data;
this.setState({ employeeStatus, targetTypeList });
}
});
};
getTaxAgentRangeListInclude = (pageModule = {}) => {
const { taxAgentId } = this.props;
const { getTaxAgentRangeListInclude } = this.props.taxAgentStore;
this.setState({ queryLoading: true });
getTaxAgentRangeListInclude({ ...pageModule, taxAgentId }).then(
({ status, data }) => {
this.setState({ queryLoading: false });
if (status && !_.isEmpty(data)) {
const {
columns,
list: dataSource,
pageNum: current,
pageSize,
total,
} = data;
this.setState({
columns,
dataSource,
pageObj: {
current,
pageSize,
total,
},
});
}
}
);
};
getTaxAgentRangeListExclude = (pageModule = {}) => {
const { taxAgentId } = this.props;
const { getTaxAgentRangeListExclude } = this.props.taxAgentStore;
this.setState({ queryLoading: true });
getTaxAgentRangeListExclude({ ...pageModule, taxAgentId }).then(
({ status, data }) => {
this.setState({ queryLoading: false });
if (status && !_.isEmpty(data)) {
const {
columns,
list: dataSource,
pageNum: current,
pageSize,
total,
} = data;
this.setState({
columns,
dataSource,
pageObj: {
current,
pageSize,
total,
},
});
}
}
);
};
taxAgentRangeDelete = ({ ids, tab }) => {
const { taxAgentRangeDelete } = this.props.taxAgentStore;
const { pageObj } = this.state;
Modal.confirm({
title: "信息确认",
content: `确认删除该条数据吗?`,
onOk: () => {
taxAgentRangeDelete(ids).then(({ status, errorMsg }) => {
if (status) {
message.success("删除成功");
tab == "1"
? this.getTaxAgentRangeListInclude({
current: pageObj.current,
pageSize: pageObj.pageSize,
})
: this.getTaxAgentRangeListExclude({
current: pageObj.current,
pageSize: pageObj.pageSize,
});
} else {
message.error(errorMsg || "删除失败");
}
});
},
onCancel() {},
});
};
taxAgentRangeSave = (module) => {
const { taxAgentId } = this.props;
const { pageObj } = this.state;
const { includeType } = module;
const { taxAgentRangeSave } = this.props.taxAgentStore;
this.setState({ submitLoading: true });
taxAgentRangeSave({ ...module, taxAgentId }).then(
({ status, errorMsg }) => {
this.setState({ submitLoading: false });
if (status) {
this.tagAgentRef.closeModal();
message.success("新增成功");
includeType == "1"
? this.getTaxAgentRangeListInclude({
current: pageObj.current,
pageSize: pageObj.pageSize,
})
: this.getTaxAgentRangeListExclude({
current: pageObj.current,
pageSize: pageObj.pageSize,
});
} else {
message.error(errorMsg || "新增失败");
}
}
);
};
render() {
const {
dataSource,
columns,
pageObj,
employeeStatus,
targetTypeList,
submitLoading,
queryLoading,
} = this.state;
return (
<div style={personScopeWarrper}>
<SlideTaxagentUser
ref={(dom) => (this.tagAgentRef = dom)}
dataSource={dataSource}
columns={columns}
pageObj={pageObj}
submitLoading={submitLoading}
queryLoading={queryLoading}
setPageObj={(params) => {
const { current, pageSize, tab } = params;
this.setState(
{
pageObj: {
...pageObj,
current,
pageSize,
},
},
() => {
tab == "1"
? this.getTaxAgentRangeListInclude({ ...pageObj, ...params })
: this.getTaxAgentRangeListExclude({ ...pageObj, ...params });
}
);
}}
employeeStatus={employeeStatus}
targetTypeList={targetTypeList}
onDeleteTaxAgent={this.taxAgentRangeDelete}
onTaxAgentSave={this.taxAgentRangeSave}
onTaxAngetSearch={({ targetName, tab }) => {
tab == "1"
? this.getTaxAgentRangeListInclude({ targetName })
: this.getTaxAgentRangeListExclude({ targetName });
}}
onChangeTab={(tab) => {
tab == "1"
? this.getTaxAgentRangeListInclude()
: this.getTaxAgentRangeListExclude();
}}
/>
</div>
);
}
}

View File

@ -0,0 +1,201 @@
import React from "react";
import { Icon, Table, message } from "antd";
import { WeaInputSearch } from "ecCom";
import AddTaxAgentModal from "./addTaxAgentModal";
export default class SlideTaxagentUser extends React.Component {
constructor(props) {
super(props);
this.state = {
addTaxagentModalVisible: false,
includeType: 1,
selectedRowKeys: [],
searchValue: "",
};
}
handleTabClick(includeType) {
const { onChangeTab } = this.props;
this.setState(
{
includeType,
},
() => {
onChangeTab && onChangeTab(includeType);
}
);
}
onSelectChange = (selectedRowKeys) => {
this.setState({ selectedRowKeys });
};
handleTabDelete = () => {
const { onDeleteTaxAgent } = this.props;
const { includeType } = this.state;
if (this.state.selectedRowKeys.length == 0) {
message.warning("未选择条目");
return;
}
onDeleteTaxAgent({ ids: this.state.selectedRowKeys, tab: includeType });
};
handleSearch = (value) => {
const { includeType } = this.state;
const { onTaxAngetSearch } = this.props;
onTaxAngetSearch({
tab: includeType,
targetName: value,
});
};
closeModal = () => {
this.setState({
addTaxagentModalVisible: false,
});
};
render() {
const {
includeType,
selectedRowKeys,
searchValue,
addTaxagentModalVisible,
} = this.state;
const {
submitLoading,
queryLoading,
dataSource,
columns: taxAgentColumns,
pageObj,
setPageObj,
employeeStatus,
targetTypeList,
onTaxAgentSave,
} = this.props;
const rowSelection = {
selectedRowKeys,
onChange: this.onSelectChange,
};
const pagination = {
total: pageObj.total,
showTotal: (total) => `${total}`,
showSizeChanger: true,
onShowSizeChange: (current, pageSize) => {
setPageObj &&
setPageObj({
current,
pageSize,
tab: includeType,
targetName: searchValue,
});
},
onChange: (current) => {
setPageObj &&
setPageObj({
current,
tab: includeType,
targetName: searchValue,
});
},
};
return (
<div className="slideRefereUser">
<div
style={{
height: "47px",
lineHeight: "47px",
paddingLeft: "10px",
paddingRight: "10px",
display: "flex",
justifyContent: "space-between",
}}>
<div
style={{
display: "inlineBlock",
color: "#666",
}}>
<span
style={{
cursor: "pointer",
color: includeType == 1 ? "#4ba9f2" : "#000",
}}
onClick={() => {
this.handleTabClick(1);
}}>
关联人员范围
</span>{" "}
{" "} | {" "}{" "}
<span
style={{
cursor: "pointer",
color: includeType == 0 ? "#4ba9f2" : "#000",
}}
onClick={() => {
this.handleTabClick(0);
}}>
从范围中排除
</span>
</div>
<div>
<div
style={{
color: "#4ba9f2",
display: "inlineBlock",
float: "left",
}}>
<Icon
style={{ cursor: "pointer", marginRight: "10px" }}
type="minus-square"
onClick={() => {
this.handleTabDelete();
}}
/>
<Icon
style={{ cursor: "pointer", marginRight: "10px" }}
type="plus-square"
onClick={() => this.setState({ addTaxagentModalVisible: true })}
/>
</div>
<WeaInputSearch
style={{ marginTop: "8px", float: "right" }}
value={searchValue}
onChange={(value) => {
this.setState({ searchValue: value });
}}
onSearch={(value) => {
this.handleSearch(value);
}}
/>
</div>
</div>
<div>
<Table
rowKey="id"
loading={queryLoading}
rowSelection={rowSelection}
dataSource={dataSource}
columns={taxAgentColumns}
pagination={pagination}
/>
</div>
<AddTaxAgentModal
loading={submitLoading}
employeeStatus={employeeStatus}
targetTypeList={targetTypeList}
onTaxAgentSave={(val) =>
onTaxAgentSave &&
onTaxAgentSave({ ...val, includeType: includeType })
}
visible={addTaxagentModalVisible}
onCancel={() => {
this.setState({ addTaxagentModalVisible: false });
}}
/>
</div>
);
}
}

View File

@ -1,10 +1,10 @@
import { observable, action, toJS } from 'mobx';
import { message } from 'antd';
import { WeaForm, WeaTableNew } from 'comsMobx';
import { observable, action, toJS } from "mobx";
import { message } from "antd";
import { WeaForm, WeaTableNew } from "comsMobx";
import * as API from '../apis/cumDeduct'; // 引入API接口文件
import * as TaxAgentApi from '../apis/taxAgent'
import { removePropertyCondition } from '../util/response';
import * as API from "../apis/cumDeduct"; // 引入API接口文件
import * as TaxAgentApi from "../apis/taxAgent";
import { removePropertyCondition } from "../util/response";
const { TableStore } = WeaTableNew;
@ -16,61 +16,87 @@ export class CumDeductStore {
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
@observable showSearchAd = false; // 高级搜索面板显示
@observable loading = true; // 数据加载状态
@observable slideLoading = true; // 详情数据加载状态
@observable step = 0; // 当前所在第几步
@observable slideVisiable = false; // slide 是否隐藏
@observable slideDataSource = [];
@observable importResult = {}
@observable importResult = {};
@observable modalVisiable = false; // 模态框显示
@observable currentRecord = {}; // 当前record
@observable columns = [];
@observable pageObj = {}; //列表数据
@observable dataSource = []; //列表数据
@observable slideColumns = []; //详情列数据
@observable slidePageObj = {}; //详情分页列表数据
@observable slideTableDataSource = []; //详情列表数据
// ** 设置导入参数 start **
// ** 设置导入参数 start **
@action
setSlideDataSource = (slideDataSource) => {
this.slideDataSource = slideDataSource
}
this.slideDataSource = slideDataSource;
};
@action
setImportResult = (importResult) => {
this.importResult = importResult
}
// ** 设置导入参数 end **
this.importResult = importResult;
};
// ** 设置导入参数 end **
@action
setCurrentRecord = currentRecord => this.currentRecord = currentRecord;
setColumns = (columns) => (this.columns = columns);
@action
setModalVisiable = visiable => this.modalVisiable = visiable
setPageObj = (pageObj) => (this.pageObj = pageObj);
@action
setStep = step => this.step = step;
setDataSource = (dataSource) => (this.dataSource = dataSource);
// 详情列表数据
@action
setSlideColumns = (columns) => (this.slideColumns = columns);
@action
setSlideVisiable = slideVisiable => this.slideVisiable = slideVisiable;
setSlidePageObj = (pageObj) => (this.slidePageObj = pageObj);
@action
setSlideTableDataSource = (dataSource) =>
(this.slideTableDataSource = dataSource);
@action
setCurrentRecord = (currentRecord) => (this.currentRecord = currentRecord);
@action
setModalVisiable = (visiable) => (this.modalVisiable = visiable);
@action
setStep = (step) => (this.step = step);
@action
setSlideVisiable = (slideVisiable) => (this.slideVisiable = slideVisiable);
// 初始化操作
@action
doInit = () => {
this.getCondition();
this.getTableDatas();
}
};
// 获得高级搜索表单数据
@action
getCondition = () => {
API.getCumDeductSaCondition().then(action(res => {
if (res.status) { // 接口请求成功/失败处理
let condition = removePropertyCondition(res.data.condition)
this.condition = condition;
this.form.initFormFields(condition); // 渲染高级搜索form表单
} else {
message.error(res.errormsg || '接口调用失败!')
}
}));
}
API.getCumDeductSaCondition().then(
action((res) => {
if (res.status) {
// 接口请求成功/失败处理
let condition = removePropertyCondition(res.data.condition);
this.condition = condition;
this.form.initFormFields(condition); // 渲染高级搜索form表单
} else {
message.error(res.errormsg || "接口调用失败!");
}
})
);
};
// 渲染table数据
@action
@ -78,71 +104,106 @@ export class CumDeductStore {
params = params || {};
this.loading = true;
let requestParams = this.form.getFormParams() || {};
requestParams = {...requestParams, ...params}
API.getCumDeductList(requestParams).then(action(res => {
if (res.status) { // 接口请求成功/失败处理
this.tableStore.getDatas(res.data.datas); // table 请求数据
} else {
message.error(res.errormsg || '接口调用失败!')
}
this.loading = false;
}));
}
requestParams = {
...requestParams,
...params,
current: this.pageObj.current,
pageSize: this.pageObj.pageSize,
};
API.getCumDeductList(requestParams).then(
action(({ status, data, errormsg }) => {
this.loading = false;
if (status) {
// 接口请求成功/失败处理
const { columns, list, total, pageNum: current, pageSize } = data;
this.setColumns(columns);
this.setDataSource(list);
this.setPageObj({
total,
current,
pageSize,
});
} else {
this.setDataSource([]);
this.setPageObj({
...this.pageObj,
total: 0,
});
message.error(errormsg || "接口调用失败!");
}
})
);
};
@action
setShowSearchAd = bool => this.showSearchAd = bool;
setShowSearchAd = (bool) => (this.showSearchAd = bool);
// 高级搜索 - 搜索
@action doSearch = () => {
this.getTableDatas();
this.showSearchAd = false;
}
};
// 导入
@action importFile = (params) => {
API.importCumDeductParam(params).then(action(res => {
if(res.status) {
this.importResult = res.data
}
}))
}
API.importCumDeductParam(params).then(
action((res) => {
if (res.status) {
this.importResult = res.data;
}
})
);
};
// 导入预览
@action previewImport = (params) => {
API.importCumDeductPreview(params).then(action(res => {
if(res.status) {
this.slideDataSource = res.data.preview
} else {
message.error(res.errormsg || '预览失败')
}
}))
}
API.importCumDeductPreview(params).then(
action((res) => {
if (res.status) {
this.slideDataSource = res.data.preview;
} else {
message.error(res.errormsg || "预览失败");
}
})
);
};
// 导出
@action exportCumDeductList = (ids = "") => {
API.exportCumDeductList(ids)
}
API.exportCumDeductList(ids);
};
// 查询明细
@action getCumDeductDetailList = (id, param = {}) => {
let requestParams = {"accumulatedSpecialAdditionalDeductionId": id};
requestParams = {...requestParams, ...param}
API.getCumDeductDetailList(requestParams).then(res => {
if(res.status) {
if (res.status) { // 接口请求成功/失败处理
this.slideTableStore.getDatas(res.data.datas); // table 请求数据
let requestParams = { accumulatedSpecialAdditionalDeductionId: id };
requestParams = { ...requestParams, ...param };
this.slideLoading = true;
API.getCumDeductDetailList(requestParams).then(
({ data, status, errormsg }) => {
this.slideLoading = false;
if (status) {
const { columns, list, total, pageNum: current, pageSize } = data;
this.setSlideColumns(columns);
this.setSlideTableDataSource(list);
this.setSlidePageObj({
total,
current,
pageSize,
});
} else {
message.error(res.errormsg || '接口调用失败!')
this.setSlideTableDataSource(list);
this.setSlidePageObj({
...this.slidePageObj,
total: 0,
});
message.error(errormsg || "接口调用失败!");
}
}
})
}
);
};
// 导出明细
@action exportCumDeductDetailList = (id, ids = "") => {
API.exportCumDeductDetailList(id, ids)
}
}
API.exportCumDeductDetailList(id, ids);
};
}

View File

@ -1,10 +1,9 @@
import { observable, action, toJS } from 'mobx';
import { message } from 'antd';
import { WeaForm, WeaTableNew } from 'comsMobx';
import { removePropertyCondition } from '../util/response';
import { observable, action, toJS } from "mobx";
import { message } from "antd";
import { WeaForm, WeaTableNew } from "comsMobx";
import { removePropertyCondition } from "../util/response";
import * as API from '../apis/cumSituation'; // 引入API接口文件
import * as TaxAgentApi from '../apis/taxAgent'
import * as API from "../apis/cumSituation"; // 引入API接口文件
const { TableStore } = WeaTableNew;
@ -19,56 +18,84 @@ export class CumSituationStore {
@observable step = 0; // 当前所在第几步
@observable slideVisiable = false; // slide 是否隐藏
@observable slideDataSource = [];
@observable importResult = {}
@observable importResult = {};
@observable modalVisiable = false; // 模态框显示
@observable currentRecord = {}; // 当前record
@observable columns = [];
@observable pageObj = {}; //列表数据
@observable dataSource = []; //列表数据
@observable slideColumns = []; //详情列数据
@observable slidePageObj = {}; //详情分页列表数据
@observable slideTableDataSource = []; //详情列表数据
// ** 设置导入参数 start **
@action
setSlideDataSource = (slideDataSource) => {
this.slideDataSource = slideDataSource
}
this.slideDataSource = slideDataSource;
};
@action
setImportResult = (importResult) => {
this.importResult = importResult
}
this.importResult = importResult;
};
// ** 设置导入参数 end **
@action
setCurrentRecord = currentRecord => this.currentRecord = currentRecord;
setColumns = (columns) => (this.columns = columns);
@action
setModalVisiable = visiable => this.modalVisiable = visiable
setPageObj = (pageObj) => (this.pageObj = pageObj);
@action
setStep = step => this.step = step;
setDataSource = (dataSource) => (this.dataSource = dataSource);
// 详情列表数据
@action
setSlideColumns = (columns) => (this.slideColumns = columns);
@action
setSlideVisiable = slideVisiable => this.slideVisiable = slideVisiable;
setSlidePageObj = (pageObj) => (this.slidePageObj = pageObj);
@action
setSlideTableDataSource = (dataSource) =>
(this.slideTableDataSource = dataSource);
@action
setCurrentRecord = (currentRecord) => (this.currentRecord = currentRecord);
@action
setModalVisiable = (visiable) => (this.modalVisiable = visiable);
@action
setStep = (step) => (this.step = step);
@action
setSlideVisiable = (slideVisiable) => (this.slideVisiable = slideVisiable);
// 初始化操作
@action
doInit = () => {
this.getCondition();
this.getTableDatas();
}
};
// 获得高级搜索表单数据
@action
getCondition = () => {
API.getCumSituationSaCondition().then(action(res => {
if (res.status) { // 接口请求成功/失败处理
let condition = removePropertyCondition(res.data.condition)
this.condition = condition;
this.form.initFormFields(condition); // 渲染高级搜索form表单
} else {
message.error(res.errormsg || '接口调用失败!')
}
}));
}
API.getCumSituationSaCondition().then(
action((res) => {
if (res.status) {
// 接口请求成功/失败处理
let condition = removePropertyCondition(res.data.condition);
this.condition = condition;
this.form.initFormFields(condition); // 渲染高级搜索form表单
} else {
message.error(res.errormsg || "接口调用失败!");
}
})
);
};
// 渲染table数据
@action
@ -76,72 +103,102 @@ export class CumSituationStore {
params = params || {};
this.loading = true;
let requestParams = this.form.getFormParams() || {};
requestParams = {...requestParams, ...params}
API.getCumSituationList(requestParams).then(action(res => {
if (res.status) { // 接口请求成功/失败处理
this.tableStore.getDatas(res.data.datas); // table 请求数据
} else {
message.error(res.errormsg || '接口调用失败!')
}
this.loading = false;
}));
}
requestParams = { ...requestParams, ...params };
API.getCumSituationList(requestParams).then(
action(({ status, data, errormsg }) => {
this.loading = false;
if (status) {
// 接口请求成功/失败处理
const { columns, list, total, pageNum: current, pageSize } = data;
this.setColumns(columns);
this.setDataSource(list);
this.setPageObj({
total,
current,
pageSize,
});
} else {
this.setDataSource([]);
this.setPageObj({
...this.pageObj,
total: 0,
});
message.error(errormsg || "接口调用失败!");
}
})
);
};
@action
setShowSearchAd = bool => this.showSearchAd = bool;
setShowSearchAd = (bool) => (this.showSearchAd = bool);
// 高级搜索 - 搜索
@action doSearch = () => {
this.getTableDatas();
this.showSearchAd = false;
}
};
// 导入
// 导入
@action importFile = (params) => {
API.importCumSituationParam(params).then(action(res => {
if(res.status) {
this.importResult = res.data
} else {
message.error(res.errormsg || '接口调用失败!')
}
}))
}
API.importCumSituationParam(params).then(
action((res) => {
if (res.status) {
this.importResult = res.data;
} else {
message.error(res.errormsg || "接口调用失败!");
}
})
);
};
// 导入预览
@action previewImport = (params) => {
API.importCumSituationPreview(params).then(action(res => {
if(res.status) {
this.slideDataSource = res.data.preview
} else {
message.error(res.errormsg || '接口调用失败!')
}
}))
}
API.importCumSituationPreview(params).then(
action((res) => {
if (res.status) {
this.slideDataSource = res.data.preview;
} else {
message.error(res.errormsg || "接口调用失败!");
}
})
);
};
// 导出
@action exportCumSituationList = (ids = "") => {
API.exportCumSituationList(ids)
}
API.exportCumSituationList(ids);
};
// 查询明细
@action getCumDeductDetailList = (id, param = {}) => {
let requestParams = {"accumulatedSituationId": id};
requestParams = {...requestParams, ...param}
API.getCumSituationDetailList(requestParams).then(res => {
if(res.status) {
if (res.status) { // 接口请求成功/失败处理
this.slideTableStore.getDatas(res.data.datas); // table 请求数据
let requestParams = { accumulatedSituationId: id };
requestParams = { ...requestParams, ...param };
API.getCumSituationDetailList(requestParams).then(
({ status, data, errormsg }) => {
if (status) {
// 接口请求成功/失败处理
const { columns, list, total, pageNum: current, pageSize } = data;
this.setSlideColumns(columns);
this.setSlideTableDataSource(list);
this.setSlidePageObj({
total,
current,
pageSize,
});
} else {
message.error(res.errormsg || '接口调用失败!')
this.setSlideTableDataSource([]);
this.setSlidePageObj({
...this.slidePageObj,
total: 0,
});
message.error(errormsg || "接口调用失败!");
}
}
})
}
);
};
// 导出明细
@action exportCumSituationDetailList = (id, ids = "") => {
API.exportCumSituationDetailList(id, ids)
}
}
API.exportCumSituationDetailList(id, ids);
};
}

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,10 @@
import { observable, action, toJS } from 'mobx';
import { message } from 'antd';
import { WeaForm, WeaTableNew } from 'comsMobx';
import { removePropertyCondition } from '../util/response';
import { observable, action, toJS } from "mobx";
import { message } from "antd";
import { WeaForm, WeaTableNew } from "comsMobx";
import { removePropertyCondition } from "../util/response";
import * as API from '../apis/otherDeduct'; // 引入API接口文件
import * as TaxAgentApi from '../apis/taxAgent'
import * as API from "../apis/otherDeduct"; // 引入API接口文件
import * as TaxAgentApi from "../apis/taxAgent";
const { TableStore } = WeaTableNew;
@ -16,60 +16,88 @@ export class OtherDeductStore {
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
@observable showSearchAd = false; // 高级搜索面板显示
@observable loading = true; // 数据加载状态
@observable slideLoading = true; // 详情数据加载状态
@observable step = 0; // 当前所在第几步
@observable slideVisiable = false; // slide 是否隐藏
@observable slideDataSource = [];
@observable importResult = {}
@observable importResult = {};
@observable modalVisiable = false; // 模态框显示
@observable currentRecord = {}; // 当前record
// ** 设置导入参数 start **
@observable columns = [];
@observable pageObj = {}; //列表数据
@observable dataSource = []; //列表数据
@observable slideColumns = []; //详情列数据
@observable slidePageObj = {}; //详情分页列表数据
@observable slideTableDataSource = []; //详情列表数据
// ** 设置导入参数 start **
@action
setSlideDataSource = (slideDataSource) => {
this.slideDataSource = slideDataSource
}
this.slideDataSource = slideDataSource;
};
@action
setImportResult = (importResult) => {
this.importResult = importResult
}
// ** 设置导入参数 end **
this.importResult = importResult;
};
@action
setCurrentRecord = currentRecord => this.currentRecord = currentRecord;
setColumns = (columns) => (this.columns = columns);
@action
setModalVisiable = visiable => this.modalVisiable = visiable
setPageObj = (pageObj) => (this.pageObj = pageObj);
@action
setStep = step => this.step = step;
setDataSource = (dataSource) => (this.dataSource = dataSource);
// 详情列表数据
@action
setSlideColumns = (columns) => (this.slideColumns = columns);
@action
setSlideVisiable = slideVisiable => this.slideVisiable = slideVisiable;
setSlidePageObj = (pageObj) => (this.slidePageObj = pageObj);
@action
setSlideTableDataSource = (dataSource) =>
(this.slideTableDataSource = dataSource);
// ** 设置导入参数 end **
@action
setCurrentRecord = (currentRecord) => (this.currentRecord = currentRecord);
@action
setModalVisiable = (visiable) => (this.modalVisiable = visiable);
@action
setStep = (step) => (this.step = step);
@action
setSlideVisiable = (slideVisiable) => (this.slideVisiable = slideVisiable);
// 初始化操作
@action
doInit = () => {
this.getCondition();
this.getTableDatas();
}
};
// 获得高级搜索表单数据
@action
getCondition = () => {
API.getOtherDeductSaCondition().then(action(res => {
if (res.status) { // 接口请求成功/失败处理
let condition = removePropertyCondition(res.data.condition)
this.condition = condition;
this.form.initFormFields(condition); // 渲染高级搜索form表单
} else {
message.error(res.errormsg || '接口调用失败!')
}
}));
}
API.getOtherDeductSaCondition().then(
action((res) => {
if (res.status) {
// 接口请求成功/失败处理
let condition = removePropertyCondition(res.data.condition);
this.condition = condition;
this.form.initFormFields(condition); // 渲染高级搜索form表单
} else {
message.error(res.errormsg || "接口调用失败!");
}
})
);
};
// 渲染table数据
@action
@ -77,72 +105,101 @@ export class OtherDeductStore {
params = params || {};
this.loading = true;
let requestParams = this.form.getFormParams() || {};
requestParams = {...requestParams, ...params}
API.getOtherDeductList(requestParams).then(action(res => {
if (res.status) { // 接口请求成功/失败处理
this.tableStore.getDatas(res.data.datas); // table 请求数据
} else {
message.error(res.errormsg || '接口调用失败!')
}
this.loading = false;
}));
}
requestParams = { ...requestParams, ...params };
API.getOtherDeductList(requestParams).then(
action(({ status, data, errormsg }) => {
if (status) {
const { columns, list, total, pageNum: current, pageSize } = data;
this.setColumns(columns);
this.setDataSource(list);
this.setPageObj({
total,
current,
pageSize,
});
} else {
this.setDataSource([]);
this.setPageObj({
...this.pageObj,
total: 0,
});
message.error(errormsg || "接口调用失败!");
}
this.loading = false;
})
);
};
@action
setShowSearchAd = bool => this.showSearchAd = bool;
setShowSearchAd = (bool) => (this.showSearchAd = bool);
// 高级搜索 - 搜索
@action doSearch = () => {
this.getTableDatas();
this.showSearchAd = false;
}
};
// 导入
@action importFile = (params) => {
API.importOtherDeductionParam(params).then(action(res => {
if(res.status) {
this.importResult = res.data
} else {
message.error(res.errormsg || '接口调用失败!')
}
}))
}
API.importOtherDeductionParam(params).then(
action((res) => {
if (res.status) {
this.importResult = res.data;
} else {
message.error(res.errormsg || "接口调用失败!");
}
})
);
};
// 导入预览
@action previewImport = (params) => {
API.importOtherDeductionPreview(params).then(action(res => {
if(res.status) {
this.slideDataSource = res.data.preview
} else {
message.error(res.errormsg || '接口调用失败!')
}
}))
}
API.importOtherDeductionPreview(params).then(
action((res) => {
if (res.status) {
this.slideDataSource = res.data.preview;
} else {
message.error(res.errormsg || "接口调用失败!");
}
})
);
};
// 导出
@action exportOtherDeductList = (ids = "") => {
API.exportOtherDeductList(ids)
}
API.exportOtherDeductList(ids);
};
// 查询明细
@action getOtherDeductDetailList = (id, param = {}) => {
let requestParams = {"otherTaxExemptDeductionId": id};
requestParams = {...requestParams, ...param}
API.getOtherDeductDetailList(requestParams).then(res => {
if(res.status) {
if (res.status) { // 接口请求成功/失败处理
this.slideTableStore.getDatas(res.data.datas); // table 请求数据
let requestParams = { otherTaxExemptDeductionId: id };
requestParams = { ...requestParams, ...param };
this.slideLoading = true;
API.getOtherDeductDetailList(requestParams).then(
({ status, data, errormsg }) => {
if (status) {
const { columns, list, total, pageNum: current, pageSize } = data;
this.setSlideColumns(columns);
this.setSlideTableDataSource(list);
this.setSlidePageObj({
total,
current,
pageSize,
});
} else {
message.error(res.errormsg || '接口调用失败!')
this.setSlideTableDataSource([]);
this.setSlidePageObj({
...this.slidePageObj,
total: 0,
});
message.error(errormsg || "接口调用失败!");
}
}
})
}
);
};
// 导出明细
@action exportOtherDeductDetailList = (id, ids = "") => {
API.exportOtherDeductDetailList(id, ids)
}
}
API.exportOtherDeductDetailList(id, ids);
};
}

View File

@ -1,137 +1,155 @@
import { observable, action, toJS } from 'mobx';
import { message } from 'antd';
import { WeaForm, WeaTableNew } from 'comsMobx';
import moment from 'moment'
import { observable, action, toJS } from "mobx";
import { message } from "antd";
import { WeaForm, WeaTableNew } from "comsMobx";
import moment from "moment";
import * as API from '../apis/taxAgent'; // 引入API接口文件
import { columns } from '../pages/socialSecurityBenefits/archives/columns';
import { dataSource } from '../pages/mySalary/columns';
import * as API from "../apis/taxAgent"; // 引入API接口文件
import { columns } from "../pages/socialSecurityBenefits/archives/columns";
import { dataSource } from "../pages/mySalary/columns";
import { editConditions } from "../pages/taxAgent/editConditions";
const { TableStore } = WeaTableNew;
export class TaxAgentStore {
@observable tableStore = new TableStore(); // new table
@observable form = new WeaForm(); // nrew 一个form
@observable form = new WeaForm(); //表单实体
@observable condition = []; // 存储后台得到的form数据
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
@observable showSearchAd = false; // 高级搜索面板显示
@observable loading = true; // 数据加载状态
@observable modalVisiable = false; // EditModal 模态框
@observable loading = false; // 数据加载状态
@observable modalVisiable = false; // EditModal 模态框
@observable columns = [];
@observable dataSource = [];
@observable pageObj = {}; //列表数据
@observable dataSource = []; //列表数据
@observable taxAgentOption = []; // 个税扣缴义务人
@action
setModalVisiable = (visiable) => (this.modalVisiable = visiable);
@action
setModalVisiable = visiable => this.modalVisiable = visiable;
setColumns = (columns) => (this.columns = columns);
@action
setColumns = columns => this.columns = columns;
setPageObj = (pageObj) => (this.pageObj = pageObj);
@action
setDataSource = dataSource => this.dataSource = dataSource;
setDataSource = (dataSource) => (this.dataSource = dataSource);
// 初始化操作
@action
doInit = () => {
this.getTableDatas();
}
doInit = (params) => {
this.getTaxAgentList(params);
this.getCondition(editConditions);
};
// 获得高级搜索表单数据
@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 || '接口调用失败!')
}
}));
}
getCondition = (condition) => {
this.form.initFormFields(condition);
};
// 渲染table数据
@action
getTableDatas = (params) => {
getTaxAgentList = (params) => {
this.loading = true;
params = params || {};
API.getTaxAgentList(params).then(action(res => {
if (res.status) { // 接口请求成功/失败处理
let current = this.tableStore.current || 1;
let sortParams = this.tableStore.sortParams.toJS() || [];
this.tableStore.getDatas(res.data.datas)
} else {
message.error(res.msg || '接口调用失败!')
}
this.loading = false;
}));
}
API.getTaxAgentList(params).then(
action(({ data, status }) => {
this.loading = false;
if (status) {
// 接口请求成功/失败处理
const { columns, list, total, pageNum: current, pageSize } = data;
this.setColumns(columns);
this.setDataSource(list);
this.setPageObj({
total,
current,
pageSize,
});
} else {
message.error(res.msg || "接口调用失败!");
}
})
);
};
@action
setShowSearchAd = bool => this.showSearchAd = bool;
setShowSearchAd = (bool) => (this.showSearchAd = bool);
// 高级搜索 - 搜索
@action doSearch = (name) => {
this.getTableDatas({name});
this.getTaxAgentList({ name });
this.showSearchAd = false;
}
};
// 新增
@action doInsert = (params) => {
API.saveTaxAgent(params).then(res => {
if(res.status) {
message.success("新增成功");
this.setModalVisiable(false)
this.getTableDatas();
this.showSearchAd = false;
} else {
message.error( res.errormsg || "新增失败");
}
})
}
@action saveTaxAgent = (params) => {
return API.saveTaxAgent(params);
};
// 更新
@action doUpdate = (params) => {
API.updateTaxAgent(params).then(res => {
if(res.status) {
message.success("更新成功");
this.setModalVisiable(false)
this.getTableDatas();
this.showSearchAd = false;
} else {
message.error(res.errormsg || "新增失败");
}
})
}
@action updateTaxAgent = (params) => {
return API.updateTaxAgent(params);
};
@action doDelete = (params) => {
API.deleteTaxAgent(params).then(res => {
if(res.status) {
message.success("删除成功");
this.setModalVisiable(false)
this.getTableDatas();
this.showSearchAd = false;
} else {
message.error( res.errormsg || "删除失败");
}
})
}
// 获取个税扣缴义务人基础信息表单
@action getTaxAgentBaseForm = (params) => {
return API.getTaxAgentBaseForm(params);
};
// 获取个税扣缴义务人表单
@action getTaxAgentForm = (params) => {
return API.getTaxAgentForm(params);
};
// 保存个税扣缴义务人基础信息
@action taxAgentBaseSave = (params) => {
return API.taxAgentBaseSave(params);
};
@action deleteTaxAgent = (params) => {
return API.deleteTaxAgent(params);
};
@action getPermission = (params) => {
return API.getPermission(params);
};
// 人员范围列表
@action getTaxAgentRangeListInclude = (params) => {
return API.getTaxAgentRangeListInclude(params);
};
// 人员范围排除列表
@action getTaxAgentRangeListExclude = (params) => {
return API.getTaxAgentRangeListExclude(params);
};
// 获取人员范围表单
@action getTaxAgentRangeForm = (params) => {
return API.getTaxAgentRangeForm(params);
};
// 人员范围保存
@action taxAgentRangeSave = (params) => {
return API.taxAgentRangeSave(params);
};
// 人员范围删除
@action taxAgentRangeDelete = (params) => {
return API.taxAgentRangeDelete(params);
};
@action fetchTaxAgentOption = () => {
return new Promise((resolve, reject) => {
API.getTaxAgentSelectList().then(action(res => {
if(res.status) {
this.taxAgentOption = res.data.list.map(item => {return {key: item.id, showname: item.content}})
resolve()
} else {
message.error(res.errormsg || "获取失败")
reject()
}
}))
})
}
}
API.getTaxAgentSelectList().then(
action((res) => {
if (res.status) {
this.taxAgentOption = res.data.map((item) => {
return { key: item.id, showname: item.content };
});
resolve();
} else {
message.error(res.errormsg || "获取失败");
reject();
}
})
);
});
};
}