Merge branch 'liys_dev' into dev

This commit is contained in:
liyongshun 2022-06-07 18:10:06 +08:00
commit dbc6134ccf
14 changed files with 1720 additions and 243 deletions

View File

@ -0,0 +1,50 @@
/*
* Author: 黎永顺
* Description:
* Date: 2022-06-07 09:52:01
* LastEditTime: 2022-06-07 17:00:34
*/
import { WeaTools } from "ecCom";
/**
* name:获取编号设置
* param {*} params serialtype SUBCOMPANY分部
* return {*}
*/
export const getCodeSetting = (params) => {
return WeaTools.callApi("/api/hrm/codeSetting/getCodeSetting", "GET", params);
};
/**
* name: 保存编号设置
* param {*} params
* return {*}
*/
export const saveOrUpdateCodeSetting = (params) => {
return WeaTools.callApi(
"/api/hrm/codeSetting/saveOrUpdateCodeSetting",
"POST",
params
);
};
/**
* name: 保存起始编号设置
* param {*} params
* return {*}
*/
export const saveStartNum = (params) => {
return WeaTools.callApi("/api/hrm/codeSetting/saveStartNum", "POST", params);
};
/**
* name: 起始编号设置
* param {*} params
* return {*}
*/
export const getStartNumForm = (params) => {
return WeaTools.callApi(
"/api/hrm/codeSetting/getStartNumForm",
"GET",
params
);
};

View File

@ -2,7 +2,7 @@
* Author: 黎永顺 * Author: 黎永顺
* Description: * Description:
* Date: 2022-05-17 16:02:56 * Date: 2022-05-17 16:02:56
* LastEditTime: 2022-05-18 18:03:07 * LastEditTime: 2022-06-07 15:30:43
*/ */
import React, { Component, Fragment } from "react"; import React, { Component, Fragment } from "react";
import { Button, Modal } from "antd"; import { Button, Modal } from "antd";
@ -13,21 +13,13 @@ import {
WeaFormItem, WeaFormItem,
WeaSelect, WeaSelect,
WeaInput, WeaInput,
WeaInputNumber,
} from "ecCom"; } from "ecCom";
import Preview from "./preview"; import Preview from "./preview";
import { i18n } from "../../../public/i18n"; import { i18n } from "../../../public/i18n";
import _ from "lodash"; import _ from "lodash";
import "../index.less"; import "../index.less";
const dataSource = [
{
value: "",
numFieldName: "字符串",
numField: "string",
},
{ value: "3", numFieldName: "流水号位数", numField: "number" },
];
const options = [ const options = [
{ {
key: "string", key: "string",
@ -51,12 +43,69 @@ class NumberComposition extends Component {
super(); super();
this.state = { this.state = {
visible: false, visible: false,
numField: "string", objectData: {
numFieldName: "字符串", numField: "string",
dataSource, numFieldName: "字符串",
},
dataSource: [],
}; };
} }
componentDidMount() {
const enums = {
STRING: "字符串",
NUMBER: "流水号位数",
YEAR: "当前年份",
MONTH: "当前月份",
DAY: "当前日期",
};
let num = 0;
const { dataSource: details, onChange } = this.props;
for (let i in details) {
if (details[i].ruletype === "STRING") {
details[i].showorder = num;
num++;
}
}
const tmpV = _.map(details, (it, index) => {
const { ruletype, rulevalue, showorder } = it;
return {
id: index,
value: rulevalue,
strLogo: Number(showorder) + 1,
numFieldName:
ruletype === "STRING"
? `${enums[ruletype]}${Number(showorder) + 1}`
: enums[ruletype],
numField: _.toLower(ruletype),
};
});
this.setState(
{
dataSource: !_.isEmpty(tmpV)
? tmpV
: [
{
id: 1,
value: "",
strLogo: 1,
numFieldName: "字符串1",
numField: "string",
},
{
id: 2,
value: 3,
numFieldName: "流水号位数",
numField: "number",
},
],
},
() => {
onChange && onChange(this.state.dataSource);
}
);
}
/** /**
* name:复选框禁用 * name:复选框禁用
* param undefined * param undefined
@ -82,20 +131,26 @@ class NumberComposition extends Component {
* return {*} * return {*}
*/ */
handleSave = () => { handleSave = () => {
const { numField, numFieldName, dataSource } = this.state; let newDataSource = [];
const objWrite = { const { objectData, dataSource } = this.state;
value: "", const { onChange } = this.props;
numFieldName, const { numField, numFieldName } = objectData;
numField, const stringRow = _.filter(dataSource, (it) => it.numField === "string"); //字符串列表
}; const maxStrLen = !_.isEmpty(stringRow)
const objView = { ? _.sortBy(stringRow, function (o) {
com: { return -o.strLogo;
value: [{ key: numField, label: "", type: "TEXT" }], })[0].strLogo
}, : 0; //字符串列表
[numField]: "", const maxIdLen = _.sortBy(dataSource, function (o) {
numFieldName, return -o.id;
numField, })[0].id; //字符串列表
};
const index = _.findIndex(dataSource, (item) => item.numField !== "string");
const lastStrindex = _.findLastIndex(
dataSource,
(item) => item.numField === "string"
);
if (numField === "year" || numField === "month" || numField === "day") { if (numField === "year" || numField === "month" || numField === "day") {
const hasYearOrMonthOrDay = _.some( const hasYearOrMonthOrDay = _.some(
dataSource, dataSource,
@ -122,87 +177,158 @@ class NumberComposition extends Component {
}); });
return; return;
} }
this.setState({
visible: false,
numField: "string",
numFieldName: "字符串",
dataSource: [...dataSource, objView],
});
} else { } else {
this.showConfirm(); this.showConfirm();
return;
} }
} else {
this.setState({
visible: false,
numField: "string",
numFieldName: "字符串",
dataSource: [...dataSource, objWrite],
});
} }
// 如果前n项为空或者当中包含非字符串项
if (index > lastStrindex) {
if (numField === "month") {
const tmpVLastYearindex = _.findLastIndex(
dataSource,
(item) => item.numField === "year"
);
dataSource.splice(tmpVLastYearindex + 1, 0, {
id: maxIdLen + 1,
value: "",
numFieldName:
numField === "string"
? `${numFieldName}${stringRow.length + 1}`
: numFieldName,
numField,
});
} else if (numField === "day") {
const tmpVLastMonthindex = _.findLastIndex(
dataSource,
(item) => item.numField === "month"
);
dataSource.splice(tmpVLastMonthindex + 1, 0, {
id: maxIdLen + 1,
value: "",
numFieldName:
numField === "string"
? `${numFieldName}${stringRow.length + 1}`
: numFieldName,
numField,
});
} else {
const tmpVLastStrindex = _.findLastIndex(
dataSource,
(item) => item.numField === "string"
);
dataSource.splice(tmpVLastStrindex + 1, 0, {
id: maxIdLen + 1,
value: "",
strLogo: maxStrLen + 1,
numFieldName:
numField === "string"
? `${numFieldName}${maxStrLen + 1}`
: numFieldName,
numField,
});
}
newDataSource = [...dataSource];
} else {
if (numField === "month") {
const tmpVLastYearindex = _.findLastIndex(
dataSource,
(item) => item.numField === "year"
);
dataSource.splice(tmpVLastYearindex + 1, 0, {
id: maxIdLen + 1,
value: "",
numFieldName:
numField === "string"
? `${numFieldName}${stringRow.length + 1}`
: numFieldName,
numField,
});
} else if (numField === "day") {
const tmpVLastMonthindex = _.findLastIndex(
dataSource,
(item) => item.numField === "month"
);
dataSource.splice(tmpVLastMonthindex + 1, 0, {
id: maxIdLen + 1,
value: "",
numFieldName:
numField === "string"
? `${numFieldName}${stringRow.length + 1}`
: numFieldName,
numField,
});
} else {
const tmpVLastStrindex = _.findLastIndex(
dataSource,
(item) => item.numField === "string"
);
dataSource.splice(tmpVLastStrindex, 0, {
id: maxIdLen + 1,
value: "",
strLogo: maxStrLen + 1,
numFieldName:
numField === "string"
? `${numFieldName}${maxStrLen + 1}`
: numFieldName,
numField,
});
}
newDataSource = [...dataSource];
}
this.setState({
visible: false,
objectData: { numField: "string", numFieldName: "字符串" },
dataSource: newDataSource,
});
onChange && onChange(newDataSource);
}; };
/** /**
* name:年月日字段重复提示 * name:年月日字段重复提示
* return {*} * return {*}
*/ */
showConfirm = () => { showConfirm = () => {
const { numFieldName } = this.state; const { objectData } = this.state;
Modal.warning({ Modal.warning({
title: "信息确认", title: "信息确认",
content: `已经添加过一个${numFieldName},请选择其他编号字段!`, content: `已经添加过一个${objectData.numFieldName},请选择其他编号字段!`,
footer: [], footer: [],
onOk() {}, onOk() {},
okText: "确认", okText: "确认",
}); });
}; };
/**
* name: 编号字段删除 handleChangeInput = (value, index, record) => {
* return {*}
*/
handleDeleteTable = (keys, datas) => {
const { dataSource } = this.state; const { dataSource } = this.state;
const stringRow = _.filter(dataSource, (it) => it.numField === "string"); const { onChange } = this.props;
const yearRow = _.filter(dataSource, (it) => it.numField === "year"); this.setState(
const monthRow = _.filter(dataSource, (it) => it.numField === "month"); {
const dayRow = _.filter(dataSource, (it) => it.numField === "day"); dataSource: _.map(dataSource, (it) => {
const disableRow = _.filter(dataSource, (it) => it.numField === "number"); if (it.id === record.id) {
const tmpV = [ return {
...stringRow, ...it,
...yearRow, value,
...monthRow, };
...dayRow, }
...disableRow, return { ...it };
]; }),
this.setState({ },
dataSource: _.filter(tmpV, (it, idx) => !keys.includes(idx)), () => {
}); onChange && onChange(this.state.dataSource);
}
);
}; };
handleChangeInput = (value, index) => { handleDragChange = (dataSource) => {
const { dataSource } = this.state; const { onChange } = this.props;
const stringRow = _.filter(dataSource, (it) => it.numField === "string"); this.setState({ dataSource });
const yearRow = _.filter(dataSource, (it) => it.numField === "year"); onChange && onChange(dataSource);
const monthRow = _.filter(dataSource, (it) => it.numField === "month");
const dayRow = _.filter(dataSource, (it) => it.numField === "day");
const disableRow = _.filter(dataSource, (it) => it.numField === "number");
const tmpV = _.map(
[...stringRow, ...yearRow, ...monthRow, ...dayRow, ...disableRow],
(it, idx) => ({ ...it, key: idx })
);
this.setState({
dataSource: _.map(tmpV, (it) => {
if (it.key === index) {
return {
...it,
value,
};
}
return { ...it };
}),
});
}; };
render() { render() {
const { visible, numField, dataSource } = this.state; const { visible, objectData, dataSource } = this.state;
const { numField, numFieldName } = objectData;
const columns = [ const columns = [
{ {
title: "", title: "",
@ -230,6 +356,17 @@ class NumberComposition extends Component {
) { ) {
return <span></span>; return <span></span>;
} }
if (numField === "number") {
return (
<WeaInputNumber
id="customNumberInput"
value={record.value}
onChange={(value) =>
this.handleChangeInput(value, index, record)
}
/>
);
}
return ( return (
<WeaInput <WeaInput
id="custom" id="custom"
@ -242,9 +379,6 @@ class NumberComposition extends Component {
}, },
}, },
], ],
// dataIndex: "value",
// key: "value",
// com: [{ label: "", type: "INPUT", viewAttr: 2, key: "value" }],
colSpan: 1, colSpan: 1,
width: "70%", width: "70%",
}, },
@ -262,32 +396,13 @@ class NumberComposition extends Component {
}_WeaMoreButton@e4f4n1`} }_WeaMoreButton@e4f4n1`}
/>, />,
]; ];
const stringRow = _.map(
_.filter(dataSource, (it) => it.numField === "string"),
(item, index) => {
return {
...item,
numFieldName: `${item.numFieldName}${index + 1}`,
};
}
);
const yearRow = _.filter(dataSource, (it) => it.numField === "year");
const monthRow = _.filter(dataSource, (it) => it.numField === "month");
const dayRow = _.filter(dataSource, (it) => it.numField === "day");
const disableRow = _.filter(dataSource, (it) => it.numField === "number");
return ( return (
<Fragment> <Fragment>
<WeaTableEdit <WeaTableEdit
draggable={true} draggable={true}
columns={columns} columns={columns}
datas={[ datas={dataSource}
...stringRow,
...yearRow,
...monthRow,
...dayRow,
...disableRow,
]}
getRowSelection={this.getRowSelection} getRowSelection={this.getRowSelection}
pushTitleIntoHeader pushTitleIntoHeader
showCopy={false} showCopy={false}
@ -299,18 +414,10 @@ class NumberComposition extends Component {
visible: true, visible: true,
}) })
} }
onDelete={this.handleDeleteTable} onChange={this.handleDragChange}
/> />
{/* 预览 */} {/* 预览 */}
<Preview <Preview dataSource={dataSource} />
dataSource={[
...stringRow,
...yearRow,
...monthRow,
...dayRow,
...disableRow,
]}
/>
{/* 新增弹框 */} {/* 新增弹框 */}
<WeaDialog <WeaDialog
onCancel={() => onCancel={() =>
@ -335,7 +442,7 @@ class NumberComposition extends Component {
value={numField} value={numField}
viewAttr={2} viewAttr={2}
onChange={(numField, numFieldName) => { onChange={(numField, numFieldName) => {
this.setState({ numField, numFieldName }); this.setState({ objectData: { numField, numFieldName } });
}} }}
/> />
</WeaFormItem> </WeaFormItem>

View File

@ -0,0 +1,40 @@
/*
* Author: 黎永顺
* Description: 起始编号设置
* Date: 2022-06-07 15:27:43
* LastEditTime: 2022-06-07 17:21:03
*/
import React, { Component } from "react";
import { WeaTableEdit, WeaInputNumber } from "ecCom";
class StartNumberSetting extends Component {
handleChangeTable = (datas) => {
const { onChange, startNumberInfo } = this.props;
const newColumns = _.map(startNumberInfo.columns, (it) => ({
...it,
com: [{ type: "INPUTNUMBER", key: it.dataIndex, viewAttr: 3, min: 0 }],
}));
onChange && onChange(newColumns, datas);
};
render() {
const { startNumberInfo } = this.props;
const newColumns = _.map(startNumberInfo.columns, (it) => ({
...it,
com: [{ type: "INPUTNUMBER", key: it.dataIndex, viewAttr: 3, min: 0 }],
}));
return (
<WeaTableEdit
draggable={false}
showAdd={false}
showDelete={false}
showCopy={false}
tableProps={{ rowSelection: {} }}
columns={newColumns}
datas={startNumberInfo.dataSource}
onChange={this.handleChangeTable}
/>
);
}
}
export default StartNumberSetting;

View File

@ -2,27 +2,117 @@
* Author: 黎永顺 * Author: 黎永顺
* Description: 起始编号及预留编号设置 * Description: 起始编号及预留编号设置
* Date: 2022-05-17 15:51:41 * Date: 2022-05-17 15:51:41
* LastEditTime: 2022-05-17 16:01:33 * LastEditTime: 2022-06-07 17:40:30
*/ */
import React, { Component, Fragment } from "react"; import React, { Component, Fragment } from "react";
import { WeaFormItem } from "ecCom"; import { Button, Modal } from "antd";
import StartNumberSetting from "./startNumberSetting";
import { WeaFormItem, WeaDialog, WeaMoreButton } from "ecCom";
import { i18n } from "../../../public/i18n";
class StartReservedNumberSet extends Component { 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() { render() {
const { dialogProps } = this.state;
const { type } = dialogProps;
const { startNumberInfo } = this.props;
return ( return (
<Fragment> <Fragment>
<WeaFormItem <WeaFormItem
label="起始编号" label="起始编号"
labelCol={{ span: 8 }} labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}> wrapperCol={{ span: 16 }}>
<i className="icon-coms-Flow-setting"></i> <i
className="icon-coms-Flow-setting"
onClick={() => this.handleClickStartNumber("start")}></i>
</WeaFormItem> </WeaFormItem>
<WeaFormItem <WeaFormItem
label="预留编号" label="预留编号"
labelCol={{ span: 8 }} labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}> wrapperCol={{ span: 16 }}>
<i className="icon-coms-Flow-setting"></i> <i
className="icon-coms-Flow-setting"
onClick={() => this.handleClickStartNumber("reserved")}></i>
</WeaFormItem> </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> </Fragment>
); );
} }

View File

@ -1,124 +1,313 @@
const { inject, observer } = mobxReact; /*
const ProductItem = ecodeSDK.imp(ProductItem); * Author: 黎永顺
const ProductDialog = ecodeSDK.imp(ProductDialog); * Description: 分部编号设置
const { toJS } = mobx; * Date: 2022-05-17 14:30:57
// const { product } = ecodeSDK.imp(productDataSource); * LastEditTime: 2022-06-07 17:49:14
const { WeaDialog } = ecCom; */
const { createRef } = React; import React, { Component, Fragment } from "react";
import { inject, observer } from "mobx-react";
import { Button, message } from "antd";
import {
WeaTop,
WeaFormItem,
WeaCheckbox,
WeaSearchGroup,
WeaSelect,
WeaHelpfulTip,
} from "ecCom";
import StartReservedNumberSet from "./components/startReservedNumberSet";
import NumberComposition from "./components/numberComposition";
import { i18n } from "../../public/i18n";
import moment from "moment";
import "./index.less";
@inject("projectStore") @inject("numberSet")
@observer @observer
class ProductIndex extends React.Component { export default class BranchNumSetting extends Component {
constructor() { constructor() {
super(); super();
this.state = { this.state = {
dialogParams: { options: [],
visible: false, loading: false,
productId: "", dataSource: [],
startNumberInfo: {
columns: [],
dataSource: [],
},
subCompanyInfo: {
details: [],
serialenable: "0",
dateSerial: {
enable: "0",
key: "",
},
}, },
dialogWidth: 1200,
dialogHeight: 100,
}; };
this.productRef = createRef();
} }
componentDidMount() { componentDidMount() {
window.addEventListener("resize", this.resizeWidthHeight); this.getCodeSetting();
this.resizeWidthHeight();
this.init();
}
conponentWillUnmount() {
window.removeEventListener("resize", this.resizeWidthHeight);
} }
resizeWidthHeight = () => { getCodeSetting = () => {
requestAnimationFrame(() => { const { numberSet } = this.props;
if (!this.productRef.current) { numberSet
return; .getCodeSetting({ serialtype: "SUBCOMPANY" })
} .then(({ api_status, details, serialenable, dateSerial = {} }) => {
const { offsetWidth, offsetHeight } = this.productRef.current; if (api_status && !_.isEmpty(details)) {
this.setState({ this.setState({
dialogWidth: offsetWidth - 100, subCompanyInfo: { details, serialenable, dateSerial },
// offsetHeight / 2 });
dialogHeight: 80, }
}); });
};
handleSubmit = () => {
const { numberSet } = this.props;
const { dataSource, subCompanyInfo } = this.state;
const { serialenable, dateSerial } = subCompanyInfo;
const details = _.map(dataSource, (it, showorder) => {
const { numField, value: rulevalue } = it;
return {
ruletype: _.upperCase(numField),
rulevalue,
showorder,
};
});
const payload = {
datas: JSON.stringify({
serialenable,
details,
dateSerial,
serialtype: "SUBCOMPANY",
}),
};
this.setState({ loading: true });
numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => {
this.setState({ loading: false });
if (api_status) {
message.success("保存成功");
}
}); });
}; };
init = () => { handleChangeCode = (data) => {
const { const tmpV = _.filter(
projectStore: { init }, data,
} = this.props; (it) =>
init(); it.numField === "year" ||
}; it.numField === "month" ||
it.numField === "day"
handlePickProduct = async (productId) => { );
const {
projectStore: { viewProject, init },
} = this.props;
const { api_status } = await viewProject(productId);
if (api_status) init();
this.setState({ this.setState({
dialogParams: { ...this.state.dialogParams, visible: true, productId }, dataSource: _.cloneDeep(data),
options: _.map(tmpV, (it) => {
const { numFieldName: showname, numField: key } = it;
return { key: _.upperCase(key), showname };
}),
}); });
}; };
handleSetNumber = (type) => {
this.handleSubmit();
const { numberSet } = this.props;
if (type === "start") {
const payload = {
coderuleid: 1,
type: "",
dateStart: moment().format("YYYY"),
dateEnd: moment().format("YYYY"),
subCompanyId: "",
deptId: "",
jobtitlesId: "",
};
numberSet
.getStartNumForm(payload)
.then(({ api_status, columns, dataSource }) => {
if (api_status) {
this.setState({
startNumberInfo: { columns, dataSource },
});
}
});
}
};
handleChangeTable = (newColumns, datas) => {
this.setState({
startNumberInfo: {
...this.state.startNumberInfo,
columns: newColumns,
dataSource: datas,
},
});
};
handleSubmitStartNumber = () => {
const { numberSet } = this.props;
const payload = {
datas: JSON.stringify({
coderuleid: 1,
...this.state.startNumberInfo,
}),
};
numberSet.saveStartNum(payload).then(({ api_status }) => {
if (api_status) {
message.success("保存成功");
this.numberSetRef.handleClose();
}
});
};
/**
* name:提示文本
* return {*}
*/
helpContent = () => {
return (
<div>
<p>开启后可根据设置的分部编号规则自动生成分部编号涉及场景如下</p>
<p>1.手动新建和手动编辑分部时可选择重新生成编号和选择预留分部编号</p>
<p>2.组织结构导入-添加新分部且分部编号列为空时会自动生成分部编号</p>
<p>3.导入人员-添加时新创建的分部可自动生成分部编号</p>
<p>注意开启前请先确认分部编号字段已启用</p>
</div>
);
};
render() { render() {
const { dialogParams, dialogHeight, dialogWidth } = this.state; const { options, subCompanyInfo, loading, startNumberInfo } = this.state;
const { const { details, serialenable, dateSerial } = subCompanyInfo;
projectStore: { product }, const btns = [
} = this.props; <Button type="primary" onClick={this.handleSubmit} loading={loading}>
保存
</Button>,
];
const dropMenuDatas = [
{
key: "save",
disabled: false,
icon: <i className="icon-coms-Preservation" />,
content: "保存",
onClick: (key) => this.handleSubmit(),
},
];
return ( return (
<div className="product-demo-wapper" ref={this.productRef}> <div className="branch-wapper">
<div className="product-container"> <WeaTop
{_.map(toJS(product), (item, index) => { title={i18n.label.branchNumSetting()}
const { id, title, subTitle, products } = item; icon={<i className="icon-coms-hrm" />}
return ( iconBgcolor="#217346"
<div className="product-box" key={id}> buttons={btns}
{/* <h2 className="product-title">{title}</h2> showDropIcon={true}
<p className="product-subtitle">{subTitle}</p> */} dropMenuDatas={dropMenuDatas}
<ProductItem />
products={products} <div className="branch-content">
onPickProduct={this.handlePickProduct} <div className="switch-wrapper">
/> <WeaFormItem
label="分部编号自动生成"
labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}>
<WeaCheckbox
value={serialenable}
helpfulTip={this.helpContent}
helpfulTipProps={{ placement: "top" }}
display="switch"
id="num-set-switch"
onChange={(checkVal) =>
this.setState({
subCompanyInfo: {
...subCompanyInfo,
serialenable: checkVal,
},
})
}
/>
</WeaFormItem>
</div>
{/* 内容区 */}
{serialenable === "1" && (
<Fragment>
<div className="numberComposition">
<WeaSearchGroup title={"编号组成"} showGroup>
<NumberComposition
onChange={this.handleChangeCode}
dataSource={details}
/>
</WeaSearchGroup>
</div> </div>
); {!_.isEmpty(options) && (
})} <div className="codeNumbering">
{/* <a <WeaSearchGroup title={"编号流水规则"} showGroup>
href="https://www.e-cology.com.cn/spa/document/index.jsp?id=7258131&router=1#/main/document/detail" <div className="switch-wrapper">
target="_blank" <WeaFormItem
className="product-link"> label="日期单独流水"
<span> labelCol={{ span: 8 }}
演示 wrapperCol={{ span: 16 }}>
<br /> <div className="codeNumbering-operateWapper">
脚本 <WeaCheckbox
</span> value={dateSerial.enable ? dateSerial.enable : "0"}
</a> */} display="switch"
id="dept-date-set-switch"
onChange={(isSingle) =>
this.setState({
subCompanyInfo: {
...subCompanyInfo,
dateSerial: {
...dateSerial,
enable: isSingle,
},
},
})
}
/>
{dateSerial.enable == "1" && (
<WeaSelect
options={options}
value={dateSerial.key}
detailtype={3}
supportCancel
onChange={(key) =>
this.setState({
subCompanyInfo: {
...subCompanyInfo,
dateSerial: {
...dateSerial,
key,
},
},
})
}
/>
)}
<WeaHelpfulTip
width={200}
title="开启后可设置按年、按月或按天单独流水如设置按年单独流水那每年的1月1日开始流水号从001开始重新流水。"
placement="topLeft"
/>
</div>
</WeaFormItem>
</div>
</WeaSearchGroup>
</div>
)}
<div className="startReservedNumberSet">
<WeaSearchGroup
title={"起始编号及预留编号设置"}
showGroup
center>
<StartReservedNumberSet
ref={(dom) => (this.numberSetRef = dom)}
onSet={this.handleSetNumber}
startNumberInfo={startNumberInfo}
onChange={this.handleChangeTable}
onSaveStartNumber={this.handleSubmitStartNumber}
/>
</WeaSearchGroup>
</div>
</Fragment>
)}
</div> </div>
{/* 弹框 */}
{dialogParams.visible && (
<WeaDialog
onCancel={() => {
this.resizeWidthHeight();
this.setState({
dialogParams: {
...this.state.dialogParams,
visible: false,
productId: "",
},
});
}}
visible={dialogParams.visible}
style={{ width: dialogWidth }}>
<div
className="product-dialog"
style={{ height: dialogHeight + "vh" }}>
<ProductDialog productId={dialogParams.productId} />
</div>
</WeaDialog>
)}
</div> </div>
); );
} }
} }
ecodeSDK.exp(ProductIndex);

View File

@ -1,9 +1,11 @@
.branch-wapper { .branch-wapper,
.dept-number-set {
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.branch-content { .branch-content,
.dept-content {
flex: 1; flex: 1;
overflow: hidden auto; overflow: hidden auto;
@ -16,6 +18,23 @@
background: #f7fbfe; background: #f7fbfe;
} }
.codeNumbering {
.codeNumbering-operateWapper {
display: flex;
align-items: center;
.wea-select {
width: inherit !important;
margin-left: 8px;
}
.wea-helpful-tip {
margin-left: 8px;
margin-top: 3px;
}
}
}
.numberComposition { .numberComposition {
.preview { .preview {
margin-top: 20px; margin-top: 20px;

View File

@ -0,0 +1,312 @@
/*
* Author: 黎永顺
* Description: 部门编号设置
* Date: 2022-06-06 09:37:39
* LastEditTime: 2022-06-07 17:44:30
*/
import React, { Component, Fragment } from "react";
import { inject, observer } from "mobx-react";
import { Button, message } from "antd";
import {
WeaTop,
WeaFormItem,
WeaCheckbox,
WeaSearchGroup,
WeaSelect,
WeaHelpfulTip,
} from "ecCom";
import StartReservedNumberSet from "../branchNumSetting/components/startReservedNumberSet";
import NumberComposition from "../branchNumSetting/components/numberComposition";
import { i18n } from "../../public/i18n";
import moment from 'moment';
import "../branchNumSetting/index.less";
@inject("numberSet")
@observer
export default class DeptNumberSet extends Component {
constructor() {
super();
this.state = {
options: [],
loading: false,
dataSource: [],
startNumberInfo: {
columns: [],
dataSource: [],
},
subCompanyInfo: {
details: [],
serialenable: "0",
dateSerial: {
enable: "0",
key: "",
},
},
};
}
componentDidMount() {
this.getCodeSetting();
}
getCodeSetting = () => {
const { numberSet } = this.props;
numberSet
.getCodeSetting({ serialtype: "DEPARTMENT" })
.then(({ api_status, details, serialenable, dateSerial = {} }) => {
if (api_status && !_.isEmpty(details)) {
this.setState({
subCompanyInfo: { details, serialenable, dateSerial },
});
}
});
};
handleSubmit = () => {
const { numberSet } = this.props;
const { dataSource, subCompanyInfo } = this.state;
const { serialenable, dateSerial } = subCompanyInfo;
const details = _.map(dataSource, (it, showorder) => {
const { numField, value: rulevalue } = it;
return {
ruletype: _.upperCase(numField),
rulevalue,
showorder,
};
});
const payload = {
datas: JSON.stringify({
serialenable,
details,
dateSerial,
serialtype: "DEPARTMENT",
}),
};
this.setState({ loading: true });
numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => {
this.setState({ loading: false });
if (api_status) {
message.success("保存成功");
}
});
};
handleChangeCode = (data) => {
const tmpV = _.filter(
data,
(it) =>
it.numField === "year" ||
it.numField === "month" ||
it.numField === "day"
);
this.setState({
dataSource: _.cloneDeep(data),
options: _.map(tmpV, (it) => {
const { numFieldName: showname, numField: key } = it;
return { key: _.upperCase(key), showname };
}),
});
};
handleSetNumber = (type) => {
this.handleSubmit();
const { numberSet } = this.props;
if (type === "start") {
const payload = {
coderuleid: 2,
type: "",
dateStart: moment().format("YYYY"),
dateEnd: moment().format("YYYY"),
subCompanyId: "",
deptId: "",
jobtitlesId: "",
};
numberSet
.getStartNumForm(payload)
.then(({ api_status, columns, dataSource }) => {
if (api_status) {
this.setState({
startNumberInfo: { columns, dataSource },
});
}
});
}
};
handleChangeTable = (newColumns, datas) => {
this.setState({
startNumberInfo: {
...this.state.startNumberInfo,
columns: newColumns,
dataSource: datas,
},
});
};
handleSubmitStartNumber = () => {
const { numberSet } = this.props;
const payload = {
datas: JSON.stringify({
coderuleid: 2,
...this.state.startNumberInfo,
}),
};
numberSet.saveStartNum(payload).then(({ api_status }) => {
if (api_status) {
message.success("保存成功");
this.numberSetRef.handleClose();
}
});
};
/**
* name:提示文本
* return {*}
*/
helpContent = () => {
return (
<div>
<p>开启后可根据设置的部门编号规则自动生成部门编号涉及场景如下</p>
<p>1.手动新建和手动编辑部门时可选择重新生成编号和选择预留部门编号</p>
<p>2.导入人员-添加时新创建的部门可自动生成部门编号</p>
<p>3.组织结构导入-添加新部门且部门编号列为空时可自动生成部门编号</p>
<p>注意开启前请先确认部门编号字段已启用</p>
</div>
);
};
render() {
const { options, subCompanyInfo, loading, startNumberInfo } = this.state;
const { details, serialenable, dateSerial } = subCompanyInfo;
const btns = [
<Button type="primary" onClick={this.handleSubmit} loading={loading}>
保存
</Button>,
];
const dropMenuDatas = [
{
key: "save",
disabled: false,
icon: <i className="icon-coms-Preservation" />,
content: "保存",
onClick: (key) => this.handleSubmit(),
},
];
return (
<div className="dept-number-set">
<WeaTop
title={i18n.label.deptNumSetting()}
icon={<i className="icon-coms-hrm" />}
iconBgcolor="#217346"
buttons={btns}
showDropIcon={true}
dropMenuDatas={dropMenuDatas}
/>
<div className="dept-content">
<div className="switch-wrapper">
<WeaFormItem
label="部门编号自动生成"
labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}>
<WeaCheckbox
value={serialenable}
helpfulTip={this.helpContent}
helpfulTipProps={{ placement: "top" }}
display="switch"
id="num-set-switch"
onChange={(checkVal) =>
this.setState({
subCompanyInfo: {
...subCompanyInfo,
serialenable: checkVal,
},
})
}
/>
</WeaFormItem>
</div>
{/* 内容区 */}
{serialenable === "1" && (
<Fragment>
<div className="numberComposition">
<WeaSearchGroup title={"编号组成"} showGroup>
<NumberComposition
onChange={this.handleChangeCode}
dataSource={details}
/>
</WeaSearchGroup>
</div>
{!_.isEmpty(options) && (
<div className="codeNumbering">
<WeaSearchGroup title={"编号流水规则"} showGroup>
<div className="switch-wrapper">
<WeaFormItem
label="日期单独流水"
labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}>
<div className="codeNumbering-operateWapper">
<WeaCheckbox
value={dateSerial.enable ? dateSerial.enable : "0"}
display="switch"
id="dept-date-set-switch"
onChange={(isSingle) =>
this.setState({
subCompanyInfo: {
...subCompanyInfo,
dateSerial: {
...dateSerial,
enable: isSingle,
},
},
})
}
/>
{dateSerial.enable == "1" && (
<WeaSelect
options={options}
value={dateSerial.key}
detailtype={3}
supportCancel
onChange={(key) =>
this.setState({
subCompanyInfo: {
...subCompanyInfo,
dateSerial: {
...dateSerial,
key,
},
},
})
}
/>
)}
<WeaHelpfulTip
width={200}
title="开启后可设置按年、按月或按天单独流水如设置按年单独流水那每年的1月1日开始流水号从001开始重新流水。"
placement="topLeft"
/>
</div>
</WeaFormItem>
</div>
</WeaSearchGroup>
</div>
)}
<div className="startReservedNumberSet">
<WeaSearchGroup
title={"起始编号及预留编号设置"}
showGroup
center>
<StartReservedNumberSet
ref={(dom) => (this.numberSetRef = dom)}
onSet={this.handleSetNumber}
startNumberInfo={startNumberInfo}
onChange={this.handleChangeTable}
onSaveStartNumber={this.handleSubmitStartNumber}
/>
</WeaSearchGroup>
</div>
</Fragment>
)}
</div>
</div>
);
}
}

View File

@ -0,0 +1,312 @@
/*
* Author: 黎永顺
* Description: 岗位编号设置
* Date: 2022-06-06 09:37:39
* LastEditTime: 2022-06-07 17:49:19
*/
import React, { Component, Fragment } from "react";
import { inject, observer } from "mobx-react";
import { Button, message } from "antd";
import {
WeaTop,
WeaFormItem,
WeaCheckbox,
WeaSearchGroup,
WeaSelect,
WeaHelpfulTip,
} from "ecCom";
import StartReservedNumberSet from "../branchNumSetting/components/startReservedNumberSet";
import NumberComposition from "../branchNumSetting/components/numberComposition";
import { i18n } from "../../public/i18n";
import moment from "moment";
import "../branchNumSetting/index.less";
@inject("numberSet")
@observer
export default class PostNumberSet extends Component {
constructor() {
super();
this.state = {
options: [],
loading: false,
dataSource: [],
startNumberInfo: {
columns: [],
dataSource: [],
},
subCompanyInfo: {
details: [],
serialenable: "0",
dateSerial: {
enable: "0",
key: "",
},
},
};
}
componentDidMount() {
this.getCodeSetting();
}
getCodeSetting = () => {
const { numberSet } = this.props;
numberSet
.getCodeSetting({ serialtype: "JOBTITLES" })
.then(({ api_status, details, serialenable, dateSerial = {} }) => {
if (api_status && !_.isEmpty(details)) {
this.setState({
subCompanyInfo: { details, serialenable, dateSerial },
});
}
});
};
handleSubmit = () => {
const { numberSet } = this.props;
const { dataSource, subCompanyInfo } = this.state;
const { serialenable, dateSerial } = subCompanyInfo;
const details = _.map(dataSource, (it, showorder) => {
const { numField, value: rulevalue } = it;
return {
ruletype: _.upperCase(numField),
rulevalue,
showorder,
};
});
const payload = {
datas: JSON.stringify({
serialenable,
details,
dateSerial,
serialtype: "JOBTITLES",
}),
};
this.setState({ loading: true });
numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => {
this.setState({ loading: false });
if (api_status) {
message.success("保存成功");
}
});
};
handleChangeCode = (data) => {
const tmpV = _.filter(
data,
(it) =>
it.numField === "year" ||
it.numField === "month" ||
it.numField === "day"
);
this.setState({
dataSource: _.cloneDeep(data),
options: _.map(tmpV, (it) => {
const { numFieldName: showname, numField: key } = it;
return { key: _.upperCase(key), showname };
}),
});
};
handleSetNumber = (type) => {
this.handleSubmit();
const { numberSet } = this.props;
if (type === "start") {
const payload = {
coderuleid: 3,
type: "",
dateStart: moment().format("YYYY"),
dateEnd: moment().format("YYYY"),
subCompanyId: "",
deptId: "",
jobtitlesId: "",
};
numberSet
.getStartNumForm(payload)
.then(({ api_status, columns, dataSource }) => {
if (api_status) {
this.setState({
startNumberInfo: { columns, dataSource },
});
}
});
}
};
handleChangeTable = (newColumns, datas) => {
this.setState({
startNumberInfo: {
...this.state.startNumberInfo,
columns: newColumns,
dataSource: datas,
},
});
};
handleSubmitStartNumber = () => {
const { numberSet } = this.props;
const payload = {
datas: JSON.stringify({
coderuleid: 3,
...this.state.startNumberInfo,
}),
};
numberSet.saveStartNum(payload).then(({ api_status }) => {
if (api_status) {
message.success("保存成功");
this.numberSetRef.handleClose();
}
});
};
/**
* name:提示文本
* return {*}
*/
helpContent = () => {
return (
<div>
<p>开启后可根据设置的部门编号规则自动生成部门编号涉及场景如下</p>
<p>1.手动新建和手动编辑部门时可选择重新生成编号和选择预留部门编号</p>
<p>2.导入人员-添加时新创建的部门可自动生成部门编号</p>
<p>3.组织结构导入-添加新部门且部门编号列为空时可自动生成部门编号</p>
<p>注意开启前请先确认部门编号字段已启用</p>
</div>
);
};
render() {
const { options, subCompanyInfo, loading, startNumberInfo } = this.state;
const { details, serialenable, dateSerial } = subCompanyInfo;
const btns = [
<Button type="primary" onClick={this.handleSubmit} loading={loading}>
保存
</Button>,
];
const dropMenuDatas = [
{
key: "save",
disabled: false,
icon: <i className="icon-coms-Preservation" />,
content: "保存",
onClick: (key) => this.handleSubmit(),
},
];
return (
<div className="dept-number-set">
<WeaTop
title={i18n.label.postNumSetting()}
icon={<i className="icon-coms-hrm" />}
iconBgcolor="#217346"
buttons={btns}
showDropIcon={true}
dropMenuDatas={dropMenuDatas}
/>
<div className="dept-content">
<div className="switch-wrapper">
<WeaFormItem
label="岗位编号自动生成"
labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}>
<WeaCheckbox
value={serialenable}
helpfulTip={this.helpContent}
helpfulTipProps={{ placement: "top" }}
display="switch"
id="num-set-switch"
onChange={(checkVal) =>
this.setState({
subCompanyInfo: {
...subCompanyInfo,
serialenable: checkVal,
},
})
}
/>
</WeaFormItem>
</div>
{/* 内容区 */}
{serialenable === "1" && (
<Fragment>
<div className="numberComposition">
<WeaSearchGroup title={"编号组成"} showGroup>
<NumberComposition
onChange={this.handleChangeCode}
dataSource={details}
/>
</WeaSearchGroup>
</div>
{!_.isEmpty(options) && (
<div className="codeNumbering">
<WeaSearchGroup title={"编号流水规则"} showGroup>
<div className="switch-wrapper">
<WeaFormItem
label="日期单独流水"
labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}>
<div className="codeNumbering-operateWapper">
<WeaCheckbox
value={dateSerial.enable ? dateSerial.enable : "0"}
display="switch"
id="dept-date-set-switch"
onChange={(isSingle) =>
this.setState({
subCompanyInfo: {
...subCompanyInfo,
dateSerial: {
...dateSerial,
enable: isSingle,
},
},
})
}
/>
{dateSerial.enable == "1" && (
<WeaSelect
options={options}
value={dateSerial.key}
detailtype={3}
supportCancel
onChange={(key) =>
this.setState({
subCompanyInfo: {
...subCompanyInfo,
dateSerial: {
...dateSerial,
key,
},
},
})
}
/>
)}
<WeaHelpfulTip
width={200}
title="开启后可设置按年、按月或按天单独流水如设置按年单独流水那每年的1月1日开始流水号从001开始重新流水。"
placement="topLeft"
/>
</div>
</WeaFormItem>
</div>
</WeaSearchGroup>
</div>
)}
<div className="startReservedNumberSet">
<WeaSearchGroup
title={"起始编号及预留编号设置"}
showGroup
center>
<StartReservedNumberSet
ref={(dom) => (this.numberSetRef = dom)}
onSet={this.handleSetNumber}
startNumberInfo={startNumberInfo}
onChange={this.handleChangeTable}
onSaveStartNumber={this.handleSubmitStartNumber}
/>
</WeaSearchGroup>
</div>
</Fragment>
)}
</div>
</div>
);
}
}

View File

@ -0,0 +1,312 @@
/*
* Author: 黎永顺
* Description: 岗位编号设置
* Date: 2022-06-06 09:37:39
* LastEditTime: 2022-06-07 17:56:42
*/
import React, { Component, Fragment } from "react";
import { inject, observer } from "mobx-react";
import { Button, message } from "antd";
import {
WeaTop,
WeaFormItem,
WeaCheckbox,
WeaSearchGroup,
WeaSelect,
WeaHelpfulTip,
} from "ecCom";
import StartReservedNumberSet from "../branchNumSetting/components/startReservedNumberSet";
import NumberComposition from "../branchNumSetting/components/numberComposition";
import { i18n } from "../../public/i18n";
import moment from "moment";
import "../branchNumSetting/index.less";
@inject("numberSet")
@observer
export default class ResourceNumberSet extends Component {
constructor() {
super();
this.state = {
options: [],
loading: false,
dataSource: [],
startNumberInfo: {
columns: [],
dataSource: [],
},
subCompanyInfo: {
details: [],
serialenable: "0",
dateSerial: {
enable: "0",
key: "",
},
},
};
}
componentDidMount() {
this.getCodeSetting();
}
getCodeSetting = () => {
const { numberSet } = this.props;
numberSet
.getCodeSetting({ serialtype: "USER" })
.then(({ api_status, details, serialenable, dateSerial = {} }) => {
if (api_status && !_.isEmpty(details)) {
this.setState({
subCompanyInfo: { details, serialenable, dateSerial },
});
}
});
};
handleSubmit = () => {
const { numberSet } = this.props;
const { dataSource, subCompanyInfo } = this.state;
const { serialenable, dateSerial } = subCompanyInfo;
const details = _.map(dataSource, (it, showorder) => {
const { numField, value: rulevalue } = it;
return {
ruletype: _.upperCase(numField),
rulevalue,
showorder,
};
});
const payload = {
datas: JSON.stringify({
serialenable,
details,
dateSerial,
serialtype: "USER",
}),
};
this.setState({ loading: true });
numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => {
this.setState({ loading: false });
if (api_status) {
message.success("保存成功");
}
});
};
handleChangeCode = (data) => {
const tmpV = _.filter(
data,
(it) =>
it.numField === "year" ||
it.numField === "month" ||
it.numField === "day"
);
this.setState({
dataSource: _.cloneDeep(data),
options: _.map(tmpV, (it) => {
const { numFieldName: showname, numField: key } = it;
return { key: _.upperCase(key), showname };
}),
});
};
handleSetNumber = (type) => {
this.handleSubmit();
const { numberSet } = this.props;
if (type === "start") {
const payload = {
coderuleid: 4,
type: "",
dateStart: moment().format("YYYY"),
dateEnd: moment().format("YYYY"),
subCompanyId: "",
deptId: "",
jobtitlesId: "",
};
numberSet
.getStartNumForm(payload)
.then(({ api_status, columns, dataSource }) => {
if (api_status) {
this.setState({
startNumberInfo: { columns, dataSource },
});
}
});
}
};
handleChangeTable = (newColumns, datas) => {
this.setState({
startNumberInfo: {
...this.state.startNumberInfo,
columns: newColumns,
dataSource: datas,
},
});
};
handleSubmitStartNumber = () => {
const { numberSet } = this.props;
const payload = {
datas: JSON.stringify({
coderuleid: 4,
...this.state.startNumberInfo,
}),
};
numberSet.saveStartNum(payload).then(({ api_status }) => {
if (api_status) {
message.success("保存成功");
this.numberSetRef.handleClose();
}
});
};
/**
* name:提示文本
* return {*}
*/
helpContent = () => {
return (
<div>
<p>开启后可根据设置的部门编号规则自动生成部门编号涉及场景如下</p>
<p>1.手动新建和手动编辑部门时可选择重新生成编号和选择预留部门编号</p>
<p>2.导入人员-添加时新创建的部门可自动生成部门编号</p>
<p>3.组织结构导入-添加新部门且部门编号列为空时可自动生成部门编号</p>
<p>注意开启前请先确认部门编号字段已启用</p>
</div>
);
};
render() {
const { options, subCompanyInfo, loading, startNumberInfo } = this.state;
const { details, serialenable, dateSerial } = subCompanyInfo;
const btns = [
<Button type="primary" onClick={this.handleSubmit} loading={loading}>
保存
</Button>,
];
const dropMenuDatas = [
{
key: "save",
disabled: false,
icon: <i className="icon-coms-Preservation" />,
content: "保存",
onClick: (key) => this.handleSubmit(),
},
];
return (
<div className="dept-number-set">
<WeaTop
title={i18n.label.userNumSetting()}
icon={<i className="icon-coms-hrm" />}
iconBgcolor="#217346"
buttons={btns}
showDropIcon={true}
dropMenuDatas={dropMenuDatas}
/>
<div className="dept-content">
<div className="switch-wrapper">
<WeaFormItem
label="人员编号自动生成"
labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}>
<WeaCheckbox
value={serialenable}
helpfulTip={this.helpContent}
helpfulTipProps={{ placement: "top" }}
display="switch"
id="num-set-switch"
onChange={(checkVal) =>
this.setState({
subCompanyInfo: {
...subCompanyInfo,
serialenable: checkVal,
},
})
}
/>
</WeaFormItem>
</div>
{/* 内容区 */}
{serialenable === "1" && (
<Fragment>
<div className="numberComposition">
<WeaSearchGroup title={"编号组成"} showGroup>
<NumberComposition
onChange={this.handleChangeCode}
dataSource={details}
/>
</WeaSearchGroup>
</div>
{!_.isEmpty(options) && (
<div className="codeNumbering">
<WeaSearchGroup title={"编号流水规则"} showGroup>
<div className="switch-wrapper">
<WeaFormItem
label="日期单独流水"
labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}>
<div className="codeNumbering-operateWapper">
<WeaCheckbox
value={dateSerial.enable ? dateSerial.enable : "0"}
display="switch"
id="dept-date-set-switch"
onChange={(isSingle) =>
this.setState({
subCompanyInfo: {
...subCompanyInfo,
dateSerial: {
...dateSerial,
enable: isSingle,
},
},
})
}
/>
{dateSerial.enable == "1" && (
<WeaSelect
options={options}
value={dateSerial.key}
detailtype={3}
supportCancel
onChange={(key) =>
this.setState({
subCompanyInfo: {
...subCompanyInfo,
dateSerial: {
...dateSerial,
key,
},
},
})
}
/>
)}
<WeaHelpfulTip
width={200}
title="开启后可设置按年、按月或按天单独流水如设置按年单独流水那每年的1月1日开始流水号从001开始重新流水。"
placement="topLeft"
/>
</div>
</WeaFormItem>
</div>
</WeaSearchGroup>
</div>
)}
<div className="startReservedNumberSet">
<WeaSearchGroup
title={"起始编号及预留编号设置"}
showGroup
center>
<StartReservedNumberSet
ref={(dom) => (this.numberSetRef = dom)}
onSet={this.handleSetNumber}
startNumberInfo={startNumberInfo}
onChange={this.handleChangeTable}
onSaveStartNumber={this.handleSubmitStartNumber}
/>
</WeaSearchGroup>
</div>
</Fragment>
)}
</div>
</div>
);
}
}

View File

@ -12,6 +12,9 @@ import Group from "./components/group/Group";
import OfficeManage from "./components/office/officeManage"; import OfficeManage from "./components/office/officeManage";
import CompanyExtend from "./components/company/CompanyExtend"; import CompanyExtend from "./components/company/CompanyExtend";
import BranchNumSetting from "./components/branchNumSetting"; import BranchNumSetting from "./components/branchNumSetting";
import DeptNumberSet from "./components/deptNumberSet";
import PostNumberSet from "./components/postNumberSet";
import ResourceNumberSet from "./components/resourceNumberSet";
import Company from "./components/company/company"; import Company from "./components/company/company";
import StaffScheme from "./components/staff/StaffScheme"; import StaffScheme from "./components/staff/StaffScheme";
import Staff from "./components/staff/Staff"; import Staff from "./components/staff/Staff";
@ -56,9 +59,20 @@ const Routes = (
path="branchNumSetting" path="branchNumSetting"
component={BranchNumSetting} component={BranchNumSetting}
/> />
<Route key="deptNumberSet" path="deptNumberSet" component={DeptNumberSet} />
<Route key="postNumberSet" path="postNumberSet" component={PostNumberSet} />
<Route
key="resourceNumberSet"
path="resourceNumberSet"
component={ResourceNumberSet}
/>
<Route key="company" path="company" component={Company} /> <Route key="company" path="company" component={Company} />
<Route key="department" path="department" component={Department} /> <Route key="department" path="department" component={Department} />
<Route key="departmentExtend" path="departmentExtend/:id" component={DepartmentExtendStore} /> <Route
key="departmentExtend"
path="departmentExtend/:id"
component={DepartmentExtendStore}
/>
<Route key="staffscheme" path="staffscheme" component={StaffScheme} /> <Route key="staffscheme" path="staffscheme" component={StaffScheme} />
<Route key="staff" path="staff" component={Staff} /> <Route key="staff" path="staff" component={Staff} />
<Route key="job" path="job" component={Job} /> <Route key="job" path="job" component={Job} />

View File

@ -129,6 +129,9 @@ export const i18n = {
editOfficeName: () => getLabel(386247, '编辑职务信息'), editOfficeName: () => getLabel(386247, '编辑职务信息'),
newOfficeClassifyName: () => getLabel(386246, '新建职务分类信息'), newOfficeClassifyName: () => getLabel(386246, '新建职务分类信息'),
branchNumSetting: () => getLabel(386246, '分部编号设置'), branchNumSetting: () => getLabel(386246, '分部编号设置'),
deptNumSetting: () => getLabel(386246, '部门编号设置'),
postNumSetting: () => getLabel(386246, '岗位编号设置'),
userNumSetting: () => getLabel(386246, '人员编号设置'),
companyName: () => getLabel(385937, '分部'), companyName: () => getLabel(385937, '分部'),
staffSchemeName: () => getLabel(385936, '编制方案'), staffSchemeName: () => getLabel(385936, '编制方案'),
newStaffScheme: () => getLabel(386246, '新建编制方案'), newStaffScheme: () => getLabel(386246, '新建编制方案'),

View File

@ -6,15 +6,15 @@ import { JobGradeStore } from "./jobgrade";
import { OfficeManageStore } from "./officeManage"; import { OfficeManageStore } from "./officeManage";
import { SequenceStore } from "./sequence"; import { SequenceStore } from "./sequence";
import { GroupStore } from "./group"; import { GroupStore } from "./group";
import {CompanyExtendStore} from "./companyextend"; import { CompanyExtendStore } from "./companyextend";
import {CompanyStore} from "./company"; import { CompanyStore } from "./company";
import {DepartmentStore} from "./department"; import { DepartmentStore } from "./department";
import {DepartmentExtendStore} from "./departmentextend"; import { DepartmentExtendStore } from "./departmentextend";
import {StaffSchemeStore} from "./staffscheme"; import { StaffSchemeStore } from "./staffscheme";
import {StaffStore} from "./staff"; import { StaffStore } from "./staff";
import {JobStore} from "./job"; import { JobStore } from "./job";
import {JobExtendStore} from "./jobextend"; import { JobExtendStore } from "./jobextend";
import { NumberSetStore } from "./numberSet";
module.exports = { module.exports = {
simpleOrgStore: new SimpleOrgStore(), simpleOrgStore: new SimpleOrgStore(),
@ -33,4 +33,5 @@ module.exports = {
staff: new StaffStore(), staff: new StaffStore(),
job: new JobStore(), job: new JobStore(),
jobExtend: new JobExtendStore(), jobExtend: new JobExtendStore(),
numberSet: new NumberSetStore(),
}; };

View File

@ -0,0 +1,30 @@
/*
* Author: 黎永顺
* Description: 编号设置
* Date: 2022-06-07 09:54:46
* LastEditTime: 2022-06-07 17:00:49
*/
import { observable, action } from "mobx";
import * as mobx from "mobx";
import * as API from "../apis/numberSet"; // 引入API接口文件
export class NumberSetStore {
@action
getCodeSetting(params) {
return API.getCodeSetting(params);
}
@action
saveOrUpdateCodeSetting(params) {
return API.saveOrUpdateCodeSetting(params);
}
@action
getStartNumForm(params) {
return API.getStartNumForm(params);
}
@action
saveStartNum(params) {
return API.saveStartNum(params);
}
}

View File

@ -1,16 +1,16 @@
// loading 效果 // loading 效果
.wea-demo-loading { .wea-demo-loading {
height: 100%; height: 100%;
text-align: center; text-align: center;
>div { >div {
position: absolute; position: absolute;
top: 50%; top: 50%;
} }
} }
html,body { html,
body {
height: 100%; height: 100%;
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -22,7 +22,9 @@ body {
color: #333333; color: #333333;
} }
#container, body, html { #container,
body,
html {
height: 100%; height: 100%;
overflow: scroll !important overflow: scroll !important
} }
@ -40,7 +42,7 @@ body {
height: 100%; height: 100%;
} }
.quickOperate{ .quickOperate {
position: fixed; position: fixed;
width: 45px; width: 45px;
height: 250px; height: 250px;
@ -48,7 +50,7 @@ body {
top: 20px; top: 20px;
// border: 1px solid #8b4513; // border: 1px solid #8b4513;
img{ img {
cursor: pointer; cursor: pointer;
width: 30px; width: 30px;
height: 30px; height: 30px;
@ -60,8 +62,4 @@ body {
display: block; display: block;
margin-top: 10px; margin-top: 10px;
} }
} }