产品-列表上面操作按钮显示两个
This commit is contained in:
parent
fca33c32c1
commit
2f4eebe6c7
|
|
@ -103,7 +103,7 @@ export default class Archives extends React.Component {
|
|||
};
|
||||
|
||||
getColumns = () => {
|
||||
const { columns, pageInfo, selectedKey } = this.state;
|
||||
const { columns, selectedKey } = this.state;
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
let tmpV = _.map(columns.filter(item => item.display === "TRUE"), item => {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import { Button, Dropdown, Menu, message, Modal, Switch } from "antd";
|
||||
import { WeaNewScroll, WeaSelect, WeaSlideModal, WeaTop } from "ecCom";
|
||||
import { WeaTableNew } from "comsMobx";
|
||||
import { renderNoright } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import { Button, Dropdown, Menu, message, Modal } from "antd";
|
||||
import { WeaLocaleProvider, WeaNewScroll, WeaSelect, WeaSlideModal, WeaTop } from "ecCom";
|
||||
import { renderNoright } from "../../../util";
|
||||
import CustomTab from "../../../components/customTab";
|
||||
import SlideModalTitle from "../../../components/slideModalTitle";
|
||||
import TipLabel from "../../../components/TipLabel";
|
||||
|
|
@ -14,11 +13,11 @@ import { paymentScopeEnum, welfareTypeEnum } from "./enum";
|
|||
import CustomPaginationTable from "../../../components/customPaginationTable";
|
||||
import TwoColContent from "../../../components/twoColContent";
|
||||
import CopySchemaModal from "./copySchemaModal";
|
||||
import "./index.less";
|
||||
import CustomBenefitsTable from "./customBenefitsTable";
|
||||
import "./index.less";
|
||||
|
||||
const WeaMobxTable = WeaTableNew.WeaTable;
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
@inject("programmeStore", "taxAgentStore", "salaryFileStore")
|
||||
@observer
|
||||
export default class Programme extends React.Component {
|
||||
|
|
@ -57,25 +56,17 @@ export default class Programme extends React.Component {
|
|||
|
||||
newColumns = newColumns.map(column => {
|
||||
let newColumn = column;
|
||||
newColumn.render = (text, record, index) => {
|
||||
newColumn.render = (text, record) => {
|
||||
//前端元素转义
|
||||
let valueSpan =
|
||||
record[newColumn.dataIndex + "span"] !== undefined
|
||||
? record[newColumn.dataIndex + "span"]
|
||||
: record[newColumn.dataIndex];
|
||||
if (newColumn.dataIndex == "id") {
|
||||
newColumn.display = false;
|
||||
}
|
||||
if (newColumn.dataIndex === "id") newColumn.display = false;
|
||||
switch (newColumn.dataIndex) {
|
||||
case "operate":
|
||||
return (
|
||||
<a
|
||||
href="javascript: void(0);"
|
||||
onClick={() => {
|
||||
this.onEdit(record);
|
||||
}}>
|
||||
编辑
|
||||
</a>
|
||||
<a href="javascript: void(0);" onClick={() => this.onEdit(record)}>编辑</a>
|
||||
);
|
||||
default:
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }}/>;
|
||||
|
|
@ -87,72 +78,38 @@ export default class Programme extends React.Component {
|
|||
newColumns.push({
|
||||
title: "操作",
|
||||
dataIndex: "operate",
|
||||
width: 120,
|
||||
render: (text, record) => {
|
||||
return (
|
||||
<a
|
||||
href="javascript:void(0);"
|
||||
onClick={() => {
|
||||
this.onEdit(record);
|
||||
}}>
|
||||
{showOperateBtn ? "编辑" : "查看"}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
});
|
||||
showOperateBtn && newColumns.push({
|
||||
key: "moreOperate",
|
||||
dataIndex: "moreOperate",
|
||||
render: (text, record) => {
|
||||
return (
|
||||
<Dropdown
|
||||
overlay={
|
||||
<Menu>
|
||||
<Menu.Item>
|
||||
<a
|
||||
onClick={() => {
|
||||
this.onCopy(record);
|
||||
}}>
|
||||
复制
|
||||
</a>
|
||||
</Menu.Item>
|
||||
{/*暂时隐藏*/}
|
||||
<Menu.Item>
|
||||
<a
|
||||
onClick={() => {
|
||||
this.onDelete(record);
|
||||
}}>
|
||||
删除
|
||||
</a>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}>
|
||||
<a href="javascript:void(0)" style={{ textDecoration: "none" }}>
|
||||
<i
|
||||
className="icon-coms-more"
|
||||
style={{ fontSize: 18 }}>
|
||||
</i>
|
||||
</a>
|
||||
</Dropdown>
|
||||
<React.Fragment>
|
||||
<a href="javascript:void(0);" onClick={() => this.onEdit(record)}
|
||||
style={{ marginRight: 10 }}>{showOperateBtn ? "编辑" : "查看"}</a>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<a href="javascript:void(0)" onClick={() => this.onCopy(record)}
|
||||
style={{ marginRight: 10 }}>{getLabel(111, "复制")}</a>
|
||||
}
|
||||
{
|
||||
showOperateBtn &&
|
||||
<Dropdown
|
||||
overlay={
|
||||
<Menu>
|
||||
<Menu.Item>
|
||||
<a href="javascript:void(0)" onClick={() => this.onDelete(record)}>{getLabel(111, "删除")}</a>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}>
|
||||
<a href="javascript:void(0)"><i className="icon-coms-more"/></a>
|
||||
</Dropdown>
|
||||
}
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
});
|
||||
return newColumns;
|
||||
};
|
||||
|
||||
handleCategoryStatusChange(record, value) {
|
||||
const { programmeStore: { updateCustomCategoryStatus } } = this.props;
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: `确认要${value ? "启用" : "停用"}吗`,
|
||||
onOk: () => {
|
||||
updateCustomCategoryStatus(record.id, value);
|
||||
},
|
||||
onCancel: () => {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onEdit(record) {
|
||||
onEdit = (record) => {
|
||||
let id = record.id;
|
||||
const { programmeStore } = this.props;
|
||||
const { getForm, selectedKey } = programmeStore;
|
||||
|
|
@ -162,15 +119,15 @@ export default class Programme extends React.Component {
|
|||
}).then(() => {
|
||||
this.setState({ slideVisiable: true, customEdit: true, currentOperate: "update" });
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
onCopy(record) {
|
||||
onCopy = (record) => {
|
||||
this.setState({
|
||||
copyId: record.id,
|
||||
copyModalValue: record.schemeName,
|
||||
copyModalVisible: true
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
onDelete = (record) => {
|
||||
const { programmeStore: { deleteScheme, deleteLoading, selectedKey } } = this.props;
|
||||
|
|
@ -422,13 +379,6 @@ export default class Programme extends React.Component {
|
|||
welfareTypeEnum={customSelectkey}
|
||||
onCustomEdit={this.onCustomEdit}
|
||||
/>
|
||||
// <WeaMobxTable // table内部做了loading加载处理,页面就不需要再加了
|
||||
// comsWeaTableStore={tableStore} // table store
|
||||
// hasOrder={true} // 是否启用排序
|
||||
// needScroll={true} // 是否启用table内部列表滚动,将自适应到父级高度
|
||||
// getColumns={this.getCustomColumns}
|
||||
// onOperatesClick={this.onCustomOperatesClick.bind(this)}
|
||||
// />
|
||||
}
|
||||
rightContent={renderCustomRightContent()}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { Button, DatePicker, Dropdown, Menu, message, Modal } from "antd";
|
||||
import { WeaNewScroll, WeaTop } from "ecCom";
|
||||
import { WeaLocaleProvider, WeaNewScroll, WeaTop } from "ecCom";
|
||||
import { renderNoright } from "../../../util";
|
||||
import Accountdialog from "./components/accountDialog";
|
||||
import AbnormalDrawer from "./components/abnormalDrawer";
|
||||
|
|
@ -12,6 +12,7 @@ import { getCalculateProgress } from "../../../apis/calculate";
|
|||
import "./index.less";
|
||||
import UnifiedTable from "../../../components/UnifiedTable";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
const MonthPicker = DatePicker.MonthPicker;
|
||||
|
||||
@inject("standingBookStore", "taxAgentStore")
|
||||
|
|
@ -139,6 +140,7 @@ export default class StandingBook extends React.Component {
|
|||
{
|
||||
title: "操作",
|
||||
dataIndex: "operate",
|
||||
width: 120,
|
||||
key: "operate",
|
||||
render: (text, r) => {
|
||||
const { billStatus, billMonth, creator } = r;
|
||||
|
|
@ -147,7 +149,7 @@ export default class StandingBook extends React.Component {
|
|||
{billStatus === "未归档" && (
|
||||
<a
|
||||
href="javascript:void(0);"
|
||||
className="linkTo"
|
||||
style={{ padding: "0 12px" }}
|
||||
onClick={() => this.handleGoDetail(billMonth, "", r.paymentOrganizationId, creator)}>
|
||||
核算
|
||||
</a>
|
||||
|
|
@ -155,7 +157,6 @@ export default class StandingBook extends React.Component {
|
|||
{billStatus === "已归档" && (
|
||||
<a
|
||||
href="javascript:void(0);"
|
||||
className="linkTo"
|
||||
onClick={() => this.socialSecurityBenefitsRecalculate({ id: r.id })}>
|
||||
重新核算
|
||||
</a>
|
||||
|
|
@ -173,12 +174,10 @@ export default class StandingBook extends React.Component {
|
|||
})
|
||||
}>
|
||||
<Menu.Item key="archive">归档</Menu.Item>
|
||||
{/* <Menu.Item key="detail">异常详情</Menu.Item> */}
|
||||
<Menu.Item key="delete">删除</Menu.Item>
|
||||
{/* <Menu.Item key="operate">操作日志</Menu.Item> */}
|
||||
</Menu>
|
||||
}>
|
||||
<i className="icon-coms-more more"/>
|
||||
<i className="icon-coms-more" style={{ marginLeft: 10 }}/>
|
||||
</Dropdown>
|
||||
)}
|
||||
{billStatus === "已归档" && (
|
||||
|
|
@ -196,7 +195,7 @@ export default class StandingBook extends React.Component {
|
|||
<Menu.Item key="view">查看</Menu.Item>
|
||||
</Menu>
|
||||
}>
|
||||
<i className="icon-coms-more more"/>
|
||||
<i className="icon-coms-more" style={{ marginLeft: 10 }}/>
|
||||
</Dropdown>
|
||||
)}
|
||||
</React.Fragment>
|
||||
|
|
|
|||
Loading…
Reference in New Issue