this.handleShowFormal()}
diff --git a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js
index 402a1851..8e03cba4 100644
--- a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js
+++ b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js
@@ -220,7 +220,7 @@ export default class FormalFormModal extends React.Component {
searchGroup && searchGroup.map(item => {
return
{this.handleItemClick(item)}}>
{item.value}
-
+
{item.value} 的字段
})
diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js
index bb01fe07..9b295e46 100644
--- a/pc4mobx/hrmSalary/pages/salaryItem/index.js
+++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js
@@ -56,8 +56,10 @@ export default class SalaryItem extends React.Component {
componentWillMount() { // 初始化渲染页面
- const { salaryItemStore: { doInit }} = this.props;
+ const { salaryItemStore: { doInit, listCanDelete }} = this.props;
doInit();
+ listCanDelete();
+
}
onEditItem(record, isedit) {
@@ -117,7 +119,8 @@ export default class SalaryItem extends React.Component {
key: "moreOperate",
dataIndex: "moreOperate",
render: (text, record) => {
- return (
+ if(record.canDelete) {
+ return (
{
@@ -127,8 +130,10 @@ export default class SalaryItem extends React.Component {
}>
-
- );
+ );
+ } else {
+ return ""
+ }
}
})
diff --git a/pc4mobx/hrmSalary/stores/ledger.js b/pc4mobx/hrmSalary/stores/ledger.js
index ff4411ed..bd5954ee 100644
--- a/pc4mobx/hrmSalary/stores/ledger.js
+++ b/pc4mobx/hrmSalary/stores/ledger.js
@@ -451,11 +451,16 @@ export class LedgerStore {
this.loading = true
API.listSalaryItem({name:searchValue, excludeIds, current}).then(res => {
if(res.status) {
- this.addSalaryItemDataSource = res.data.list.map(item => {
- item = {...item}
- item.key = item.id
- return item;
- });
+ if(res.data.list) {
+ this.addSalaryItemDataSource = res.data.list.map(item => {
+ item = {...item}
+ item.key = item.id
+ return item;
+ });
+ } else {
+ this.addSalaryItemDataSource = []
+ }
+
this.addSalaryItemColumns = res.data.columns;
this.addSalaryItemPageInfo = res.data
// this.salaryItemTableStore.getDatas(res.data.datas);
@@ -482,15 +487,17 @@ export class LedgerStore {
let itemGroups = [...this.itemGroups]
itemGroups = itemGroups.map(item => {
let result = {...item}
- result.items = result.items.map((i,index) => (
- {
- salaryItemId: i.salaryItemId,
- sortedIndex: index + 1,
- formulaId: i.formulaId
- }
- ))
- return result;
- })
+ if(result.items) {
+ result.items = result.items.map((i,index) => (
+ {
+ salaryItemId: i.salaryItemId,
+ sortedIndex: index + 1,
+ formulaId: i.formulaId
+ }
+ ))
+ return result;
+ }
+ }).filter(item => item)
let params = {
salarySobId: this.salarySobId,
diff --git a/pc4mobx/hrmSalary/stores/mySalary.js b/pc4mobx/hrmSalary/stores/mySalary.js
index 86df1e2a..b3f88575 100644
--- a/pc4mobx/hrmSalary/stores/mySalary.js
+++ b/pc4mobx/hrmSalary/stores/mySalary.js
@@ -27,6 +27,11 @@ export class MySalaryStore {
// 工资单详情
@observable mySalaryBill = {};
+ // 调薪记录
+ @observable recordListColumns = [];
+ @observable recordListDataSource = [];
+ @observable recordListPageInfo = {}
+
@action
initParams = () => {
let month = moment().format("YYYY-MM")
@@ -119,5 +124,16 @@ export class MySalaryStore {
}
})
}
+
+ @action
+ getRecordList = (params = {}) => {
+ API.recordList(params).then(res => {
+ if(res.status) {
+ this.recordListColumns = res.data.columns
+ this.recordListDataSource = res.data.list ? res.data.list : []
+ this.recordListPageInfo = res.data
+ }
+ })
+ }
}
\ No newline at end of file
diff --git a/pc4mobx/hrmSalary/stores/payroll.js b/pc4mobx/hrmSalary/stores/payroll.js
index f6a26d89..234856b4 100644
--- a/pc4mobx/hrmSalary/stores/payroll.js
+++ b/pc4mobx/hrmSalary/stores/payroll.js
@@ -113,12 +113,14 @@ export class payrollStore {
// 工资单模板-工资单模板列表
@action
getPayrollTemplateList = (params = {}) => {
+ this.loading = true
API.getPayrollTemplateList(params).then(res => {
if(res.status) {
this.templateStore.getDatas(res.data.datas);
} else {
message.error(res.errormsg || "获取失败");
}
+ this.loading = false;
})
}
@@ -296,12 +298,16 @@ export class payrollStore {
let params = {
id
}
- API.changePayrollDefaultUse(params).then(res => {
- if(res.status) {
- message.success("设置成功");
- } else {
- message.success(res.errormsg || "设置失败")
- }
+ return new Promise((resolve, reject) => {
+ API.changePayrollDefaultUse(params).then(res => {
+ if(res.status) {
+ message.success("设置成功");
+ resolve()
+ } else {
+ message.success(res.errormsg || "设置失败")
+ reject()
+ }
+ })
})
}
diff --git a/pc4mobx/hrmSalary/stores/salaryItem.js b/pc4mobx/hrmSalary/stores/salaryItem.js
index 82569fb4..d7719f51 100644
--- a/pc4mobx/hrmSalary/stores/salaryItem.js
+++ b/pc4mobx/hrmSalary/stores/salaryItem.js
@@ -34,6 +34,9 @@ export class SalaryItemStore {
@observable tableDataSource = []; // 主列表
@observable tableColumns = []; // 主列表列
@observable pageInfo = {}; // 分页数据
+
+ // 可以删除的项目
+ @observable canDeleteList = []
// ** 公式 **
// 类型列表
@@ -229,6 +232,11 @@ export class SalaryItemStore {
message.warning("取值方式不能为空")
return false;
}
+
+ if((params.valueType == 2 || params.valueType == 3) && !notNull(params.formulaId)) {
+ message.warning("公式不能为空")
+ return false;
+ }
return true
}
@@ -310,4 +318,17 @@ export class SalaryItemStore {
})
}
+
+ //
+ @action
+ listCanDelete = (params = {}) => {
+ API.listCanDelete(params).then(res => {
+ if(res.status) {
+ this.canDeleteList = res.data
+ console.log("this.canDeleteList: ", this.canDeleteList);
+ } else {
+ message.error(res.errormsg || "获取失败")
+ }
+ })
+ }
}
\ No newline at end of file