122 lines
3.4 KiB
JavaScript
122 lines
3.4 KiB
JavaScript
/*
|
|
* Author: 黎永顺
|
|
* Description: 起始编号及预留编号设置
|
|
* Date: 2022-05-17 15:51:41
|
|
* LastEditTime: 2022-06-07 17:40:30
|
|
*/
|
|
import React, { Component, Fragment } from "react";
|
|
import { Button, Modal } from "antd";
|
|
import StartNumberSetting from "./startNumberSetting";
|
|
import { WeaFormItem, WeaDialog, WeaMoreButton } from "ecCom";
|
|
import { i18n } from "../../../public/i18n";
|
|
|
|
class StartReservedNumberSet extends Component {
|
|
constructor() {
|
|
super();
|
|
this.state = {
|
|
dialogProps: {
|
|
type: "start",
|
|
visible: false,
|
|
title: "",
|
|
},
|
|
};
|
|
}
|
|
handleClickStartNumber = (type) => {
|
|
const { onSet } = this.props;
|
|
const { dialogProps } = this.state;
|
|
onSet && onSet(type);
|
|
this.setState({
|
|
dialogProps: {
|
|
...dialogProps,
|
|
type,
|
|
visible: true,
|
|
title: type === "start" ? "起始编号" : "预留编号",
|
|
},
|
|
});
|
|
};
|
|
handleChangeTable = (newColumns, datas) => {
|
|
const { onChange } = this.props;
|
|
onChange && onChange(newColumns, datas);
|
|
};
|
|
handleSave = () => {
|
|
const { onSaveStartNumber } = this.props;
|
|
onSaveStartNumber && onSaveStartNumber();
|
|
};
|
|
handleClose = () => {
|
|
this.setState({
|
|
dialogProps: {
|
|
...this.state.dialogProps,
|
|
visible: false,
|
|
},
|
|
});
|
|
};
|
|
render() {
|
|
const { dialogProps } = this.state;
|
|
const { type } = dialogProps;
|
|
const { startNumberInfo } = this.props;
|
|
return (
|
|
<Fragment>
|
|
<WeaFormItem
|
|
label="起始编号"
|
|
labelCol={{ span: 8 }}
|
|
wrapperCol={{ span: 16 }}>
|
|
<i
|
|
className="icon-coms-Flow-setting"
|
|
onClick={() => this.handleClickStartNumber("start")}></i>
|
|
</WeaFormItem>
|
|
<WeaFormItem
|
|
label="预留编号"
|
|
labelCol={{ span: 8 }}
|
|
wrapperCol={{ span: 16 }}>
|
|
<i
|
|
className="icon-coms-Flow-setting"
|
|
onClick={() => this.handleClickStartNumber("reserved")}></i>
|
|
</WeaFormItem>
|
|
{/* 起始/预留编号设置 */}
|
|
<WeaDialog
|
|
onCancel={this.handleClose}
|
|
icon="icon-coms-hrm"
|
|
iconBgcolor="#217346"
|
|
{...dialogProps}
|
|
hasScroll
|
|
style={{ width: 900 }}
|
|
maxHeight={150}
|
|
buttons={
|
|
type === "start"
|
|
? [
|
|
<Button
|
|
ecId={`${
|
|
(this && this.props && this.props.ecId) || ""
|
|
}_Button@jd6baw`}
|
|
onClick={this.handleSave}
|
|
type="primary">
|
|
{i18n.button.save()}
|
|
</Button>,
|
|
<WeaMoreButton
|
|
ecId={`${
|
|
(this && this.props && this.props.ecId) || ""
|
|
}_WeaMoreButton@e4f4n1`}
|
|
/>,
|
|
]
|
|
: [
|
|
<WeaMoreButton
|
|
ecId={`${
|
|
(this && this.props && this.props.ecId) || ""
|
|
}_WeaMoreButton@e4f4n1`}
|
|
/>,
|
|
]
|
|
}>
|
|
{type === "start" && (
|
|
<StartNumberSetting
|
|
startNumberInfo={startNumberInfo}
|
|
onChange={this.handleChangeTable}
|
|
/>
|
|
)}
|
|
</WeaDialog>
|
|
</Fragment>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default StartReservedNumberSet;
|