{this.onEdit(record)}}
+ dangerouslySetInnerHTML={{ __html: valueSpan }} />
+ default:
+ return
+ }
+ }
+ return newColumn;
+ });
+ return newColumns;
+ }
+
+ onEdit = (record) => {
+ const {taxRateStore: {setSlideVisiable, emptyForm, getItemInform }} = this.props;
+ emptyForm();
+ setSlideVisiable(true);
+ getItemInform(record.id)
+ }
+
render() {
const { taxRateStore } = this.props;
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = taxRateStore;
- const { doSave, slideVisiable, setSlideVisiable } = taxRateStore
+ const { doSave, slideVisiable, setSlideVisiable, emptyForm } = taxRateStore
if (!hasRight && !loading) { // 无权限处理
return renderNoright();
}
@@ -69,11 +96,15 @@ export default class TaxRate extends React.Component {
const renderSearchOperationItem = () => {
return
-
+
{' '}
{doSearch({name})}}
+
/>
@@ -106,12 +137,13 @@ export default class TaxRate extends React.Component {
comsWeaTableStore={tableStore} // table store
hasOrder={true} // 是否启用排序
needScroll={true} // 是否启用table内部列表滚动,将自适应到父级高度
-
+ getColumns={this.getColumns}
/>
- setSlideVisiable(false)}
showMask={true}
closeMaskOnClick={() => setSlideVisiable(false)} />
+ }
)
}
diff --git a/pc4mobx/hrmSalary/stores/taxRate.js b/pc4mobx/hrmSalary/stores/taxRate.js
index 6586327c..e0f3c22b 100644
--- a/pc4mobx/hrmSalary/stores/taxRate.js
+++ b/pc4mobx/hrmSalary/stores/taxRate.js
@@ -75,7 +75,28 @@ export class taxRateStore {
this.showSearchAd = false;
this.setSlideVisiable(false);
} else {
- message.error("保存失败");
+ message.warning("保存失败: " + res.errormsg ? res.errormsg: "");
+ }
+ })
+ }
+
+ @action emptyForm = () => {
+ this.setDataSource([]);
+ this.setNameValue("");
+ this.setRemarkValue("");
+ }
+
+ // 获取表单数据
+ @action getItemInform = (id) => {
+ API.getTaxRateForm({id}).then(res => {
+
+ if(res.status) {
+ let { taxRateBatch, taxRateRecords } = res.data.form
+ this.setNameValue(taxRateBatch.name);
+ this.setRemarkValue(taxRateBatch.description);
+ this.setDataSource(taxRateRecords)
+ } else {
+ message.error("获取数据失败");
}
})
}