}
iconBgcolor="#217346"
buttons={btns}
@@ -203,7 +291,7 @@ export default class DeptNumberSet extends Component {
@@ -254,6 +343,7 @@ export default class DeptNumberSet extends Component {
dateSerial: {
...dateSerial,
enable: isSingle,
+ key: isSingle == '0' ? 'YEAR' : dateSerial.key
},
},
})
@@ -261,7 +351,7 @@ export default class DeptNumberSet extends Component {
/>
{dateSerial.enable == "1" && (
({ ...item, showname: item.showname.substr(2, 1) }))}
value={dateSerial.key}
detailtype={3}
supportCancel
@@ -297,9 +387,20 @@ export default class DeptNumberSet extends Component {
(this.numberSetRef = dom)}
onSet={this.handleSetNumber}
+ companyInfo={subCompanyInfo}
+ loading={loading}
startNumberInfo={startNumberInfo}
onChange={this.handleChangeTable}
onSaveStartNumber={this.handleSubmitStartNumber}
+ onDeleteReservedNumber={this.deleteReservedNumber}
+ onAddReservedNumber={this.handleAddReservedNumber}
+ onSubmitReservedNumber={this.handleSubmitReservedNumber}
+ onSearchReservedNumberset={() =>
+ numberSet.getSearchReservedCodeList({
+ serialtype: "JOBTITLES",
+ checkboxType: "multi",
+ })
+ }
/>
diff --git a/pc4mobx/organization/components/numberSetting/resourceNumberSet/index.js b/pc4mobx/organization/components/numberSetting/resourceNumberSet/index.js
new file mode 100644
index 0000000..d1245a2
--- /dev/null
+++ b/pc4mobx/organization/components/numberSetting/resourceNumberSet/index.js
@@ -0,0 +1,529 @@
+/*
+ * Author: 黎永顺
+ * Description: 岗位编号设置
+ * Date: 2022-06-06 09:37:39
+ * LastEditTime: 2022-06-15 10:36: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 { serialFieldOptions } from "../constants";
+import { i18n } from "../../../public/i18n";
+import moment from "moment";
+import "../branchNumSetting/index.less";
+const resourceSerialFieldOptions = [
+ { key: 'subcompany', showname: "分部编号" },
+ { key: 'department', showname: "部门编号" },
+ { key: 'jobtitles', showname: "岗位编号" }
+]
+
+@inject("numberSet")
+@observer
+export default class ResourceNumberSet extends Component {
+ constructor() {
+ super();
+ this.state = {
+ options: [],
+ loading: false,
+ dataSource: [],
+ startNumberInfo: {
+ columns: [],
+ dataSource: [],
+ },
+ subCompanyInfo: {
+ details: [],
+ serialenable: "0",
+ deptSerial: {
+ enable: "0",
+ key: "",
+ },
+ jobtitlesSerial: {
+ enable: "0",
+ key: "",
+ },
+ dateSerial: {
+ enable: "0",
+ key: "",
+ },
+ },
+ };
+ }
+
+ componentDidMount() {
+ this.getCodeSetting();
+ }
+
+ getCodeSetting = () => {
+ const { numberSet } = this.props;
+ numberSet
+ .getCodeSetting({ serialtype: "USER" })
+ .then(({ api_status, details, serialenable, dateSerial = {}, jobtitlesSerial = {}, deptSerial = {} }) => {
+ if (api_status && !_.isEmpty(details)) {
+ this.setState({
+ subCompanyInfo: { details, serialenable, dateSerial, jobtitlesSerial, deptSerial },
+ });
+ }
+ });
+ };
+
+ handleSubmit = () => {
+ let promise = new Promise((resolve, reject) => {
+ const { numberSet } = this.props;
+ const { dataSource, subCompanyInfo } = this.state;
+ const { serialenable, dateSerial, jobtitlesSerial, deptSerial } = 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,
+ jobtitlesSerial, deptSerial,
+ serialtype: "USER",
+ }),
+ };
+ this.setState({ loading: true });
+ numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => {
+ this.setState({ loading: false });
+ if (api_status) {
+ message.success("保存成功");
+ resolve(api_status);
+ } else {
+ reject("接口调用失败");
+ }
+ });
+ });
+ return promise;
+ };
+
+ handleChangeCode = (data) => {
+ const tmpV = _.filter(
+ data,
+ (it) =>
+ it.numField === "year" ||
+ it.numField === "month" ||
+ it.numField === "day" ||
+ it.numField === "subcompany" ||
+ it.numField === "department" ||
+ it.numField === "jobtitles"
+ );
+ this.setState({
+ dataSource: _.cloneDeep(data),
+ options: _.map(tmpV, (it) => {
+ const { numFieldName: showname, numField: key } = it;
+ return { key: _.upperCase(key), showname };
+ }),
+ });
+ };
+
+ handleSetNumber = (type, data = {}) => {
+ this.handleSubmit().then(() => {
+ const { numberSet } = this.props;
+ const { subCompanyInfo } = this.state;
+ const { dateSerial, deptSerial, jobtitlesSerial } = subCompanyInfo;
+ if (type === "start") {
+ const formatVal = dateSerial.key === "YEAR" ? "YYYY" : dateSerial.key === "MONTH" ? "YYYY-MM" : "YYYY-MM-DD";
+ let payload = {
+ coderuleid: 3,
+ type: dateSerial.enable == '1' ? dateSerial.key : '',
+ dateStart: data.startDate ? data.startDate : moment().format(formatVal),
+ dateEnd: data.endDate ? data.endDate : moment().format(formatVal),
+ subCompanyId: data.subCompanyId ? data.subCompanyId : "",
+ deptId: data.deptId ? data.deptId : "",
+ jobtitlesId: data.jobtitlesId ? data.jobtitlesId : "",
+ };
+ if (deptSerial.enable === '1' && deptSerial.key === 'SUBCOMPANY' && !data.subCompanyId) return
+ if (deptSerial.enable === '1' && deptSerial.key === 'DEPARTMENT' && !data.deptId) return
+ if (jobtitlesSerial.enable === '1' && !data.jobtitlesId) return
+ if (deptSerial.enable === '1' && data.subCompanyId) {
+ payload = { ...payload, type: payload.type + ',' + deptSerial.key }
+ }
+ if (jobtitlesSerial.enable === '1' && data.jobtitlesId) {
+ payload = { ...payload, type: payload.type + ',' + jobtitlesSerial.key }
+ }
+ numberSet
+ .getStartNumForm(payload)
+ .then(({ api_status, columns, dataSource }) => {
+ if (api_status) {
+ this.setState({
+ startNumberInfo: { columns, dataSource },
+ });
+ }
+ });
+ } else {
+ numberSet.getAdvanceSearchCondition();
+ numberSet.getSearchReservedCodeList({
+ serialtype: "USER",
+ checkboxType: "multi",
+ });
+ }
+ });
+ };
+
+ 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: 删除预留编号
+ * param {*} ids
+ * return {*}
+ */
+ deleteReservedNumber = (ids) => {
+ const { numberSet } = this.props;
+ numberSet.deleteReservedCodeById({ ids }).then(({ api_status }) => {
+ if (api_status) {
+ message.success("删除成功");
+ numberSet.getSearchReservedCodeList({
+ serialtype: "USER",
+ checkboxType: "multi",
+ });
+ }
+ });
+ };
+ /**
+ * name:新增预留编号
+ * return {*}
+ */
+ handleAddReservedNumber = () => {
+ const { numberSet } = this.props;
+ const { reservedForm } = numberSet;
+ const { options } = this.state;
+ numberSet.getReservedCodeFrom({ serialtype: "USER" }).then(() => {
+ const type = _.get(_.last(options), ['key']);
+ const format = type === "YEAR" ? "YYYY" : type === "MONTH" ? "YYYY-MM" : "YYYY-MM-DD"
+ const payload = {
+ coderuleid: 3,
+ type,
+ dateStart: moment().format(format),
+ dateEnd: moment().format(format),
+ subCompanyId: "",
+ deptId: "",
+ jobtitlesId: "",
+ };
+ numberSet
+ .getStartNumForm(payload)
+ .then(({ api_status, dataSource }) => {
+ if (api_status && !_.isEmpty(dataSource)) {
+ const currentnumber = _.get(_.last(dataSource), ['startnum']);
+ reservedForm.updateFields({
+ currentnumber: {
+ value: currentnumber,
+ },
+ });
+ }
+ });
+ })
+ };
+ /**
+ * name: 保存预留设置
+ * param {*} params
+ * return {*}
+ */
+ handleSubmitReservedNumber = (params) => {
+ const { numberSet } = this.props;
+ const payload = { ...params, serialtype: "USER" };
+ numberSet.saveReservedCode(payload).then(({ api_status }) => {
+ if (api_status) {
+ message.success("保存成功");
+ this.numberSetRef.handleCloseReservedModal();
+ numberSet.getSearchReservedCodeList({
+ serialtype: "USER",
+ checkboxType: "multi",
+ });
+ }
+ });
+ };
+
+ /**
+ * name:提示文本
+ * return {*}
+ */
+ helpContent = () => {
+ return (
+
+
开启后,可根据设置的部门编号规则自动生成部门编号,涉及场景如下:
+
1.手动新建和手动编辑部门时可选择重新生成编号和选择预留部门编号;
+
2.导入人员-添加时,新创建的部门可自动生成部门编号;
+
3.组织结构导入-添加新部门且部门编号列为空时可自动生成部门编号;
+
【注意】开启前请先确认部门编号字段已启用!
+
+ );
+ };
+ render() {
+ const { options, subCompanyInfo, loading, startNumberInfo } = this.state;
+ const { numberSet } = this.props;
+ const { details, serialenable, dateSerial, jobtitlesSerial, deptSerial } = subCompanyInfo;
+ const btns = [
+
,
+ ];
+ const dropMenuDatas = [
+ {
+ key: "save",
+ disabled: false,
+ icon:
,
+ content: "保存",
+ onClick: (key) => this.handleSubmit(),
+ },
+ ];
+ return (
+
+
}
+ iconBgcolor="#217346"
+ buttons={btns}
+ showDropIcon={true}
+ dropMenuDatas={dropMenuDatas}
+ />
+
+
+
+
+ this.setState({
+ subCompanyInfo: {
+ ...subCompanyInfo,
+ serialenable: checkVal,
+ },
+ })
+ }
+ />
+
+
+ {/* 内容区 */}
+ {serialenable === "1" && (
+
+
+
+
+
+
+ {!_.isEmpty(options) && (
+
+
+ {
+ !_.isEmpty(_.filter(options, item => ["YEAR", "MONTH", "DAY"].includes(item.key))) &&
+ !["YEAR", "MONTH", "DAY"].includes(item.key))) && 0 }}>
+
+
+
+ this.setState({
+ subCompanyInfo: {
+ ...subCompanyInfo,
+ dateSerial: {
+ ...dateSerial,
+ enable: isSingle,
+ key: isSingle == '0' ? 'YEAR' : dateSerial.key
+ },
+ },
+ })
+ }
+ />
+ {dateSerial.enable == "1" && (
+ ["YEAR", "MONTH", "DAY"].includes(item.key)), it => ({ ...it, showname: it.showname.substr(2, 1) }))}
+ value={dateSerial.key}
+ detailtype={3}
+ supportCancel
+ onChange={(key) =>
+ this.setState({
+ subCompanyInfo: {
+ ...subCompanyInfo,
+ dateSerial: {
+ ...dateSerial,
+ key,
+ },
+ },
+ })
+ }
+ />
+ )}
+
+
+
+
+ }
+ {
+ !_.isEmpty(_.filter(options, item => ["SUBCOMPANY", "DEPARTMENT"].includes(item.key))) &&
+ !["JOBTITLES"].includes(item.key))) && 0 }}>
+
+
+
+ this.setState({
+ subCompanyInfo: {
+ ...subCompanyInfo,
+ deptSerial: {
+ ...deptSerial,
+ enable: isSingle,
+ },
+ },
+ })
+ }
+ />
+ {deptSerial.enable == "1" && (
+ ["SUBCOMPANY", "DEPARTMENT"].includes(item.key)), it => ({ ...it, showname: it.showname.substr(0, 2) }))}
+ value={deptSerial.key}
+ detailtype={3}
+ supportCancel
+ onChange={(key) =>
+ this.setState({
+ subCompanyInfo: {
+ ...subCompanyInfo,
+ deptSerial: {
+ ...deptSerial,
+ key,
+ },
+ },
+ })
+ }
+ />
+ )}
+
+
+
+
+ }
+ {
+ !_.isEmpty(_.filter(options, item => ["JOBTITLES"].includes(item.key))) &&
+
+
+
+
+ this.setState({
+ subCompanyInfo: {
+ ...subCompanyInfo,
+ jobtitlesSerial: {
+ ...jobtitlesSerial,
+ enable: isSingle,
+ },
+ },
+ })
+ }
+ />
+
+
+
+
+ }
+
+
+ )}
+
+
+ (this.numberSetRef = dom)}
+ onSet={this.handleSetNumber}
+ companyInfo={subCompanyInfo}
+ loading={loading}
+ startNumberInfo={startNumberInfo}
+ onChange={this.handleChangeTable}
+ onSaveStartNumber={this.handleSubmitStartNumber}
+ onDeleteReservedNumber={this.deleteReservedNumber}
+ onAddReservedNumber={this.handleAddReservedNumber}
+ onSubmitReservedNumber={this.handleSubmitReservedNumber}
+ onSearchReservedNumberset={() =>
+ numberSet.getSearchReservedCodeList({
+ serialtype: "USER",
+ checkboxType: "multi",
+ })
+ }
+ />
+
+
+
+ )}
+
+
+ );
+ }
+}
diff --git a/pc4mobx/organization/components/postNumberSet/index.js b/pc4mobx/organization/components/postNumberSet/index.js
deleted file mode 100644
index 5866c6c..0000000
--- a/pc4mobx/organization/components/postNumberSet/index.js
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
- * Author: 黎永顺
- * Description: 岗位编号设置
- * Date: 2022-06-06 09:37:39
- * LastEditTime: 2022-06-07 18:13:32
- */
-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 (
-
-
开启后,可根据设置的岗位编号规则自动生成岗位编号,涉及场景如下:
-
1.新建岗位和编辑岗位时可选择重新生成编号和选择预留编号;
-
2.导入人员-添加时,新创建的岗位可自动生成岗位编号;
-
3.岗位导入新岗位且岗位编号列为空时可自动生成编号;
-
- );
- };
- render() {
- const { options, subCompanyInfo, loading, startNumberInfo } = this.state;
- const { details, serialenable, dateSerial } = subCompanyInfo;
- const btns = [
-
,
- ];
- const dropMenuDatas = [
- {
- key: "save",
- disabled: false,
- icon:
,
- content: "保存",
- onClick: (key) => this.handleSubmit(),
- },
- ];
- return (
-
-
}
- iconBgcolor="#217346"
- buttons={btns}
- showDropIcon={true}
- dropMenuDatas={dropMenuDatas}
- />
-
-
-
-
- this.setState({
- subCompanyInfo: {
- ...subCompanyInfo,
- serialenable: checkVal,
- },
- })
- }
- />
-
-
- {/* 内容区 */}
- {serialenable === "1" && (
-
-
-
-
-
-
- {!_.isEmpty(options) && (
-
-
-
-
-
-
- this.setState({
- subCompanyInfo: {
- ...subCompanyInfo,
- dateSerial: {
- ...dateSerial,
- enable: isSingle,
- },
- },
- })
- }
- />
- {dateSerial.enable == "1" && (
-
- this.setState({
- subCompanyInfo: {
- ...subCompanyInfo,
- dateSerial: {
- ...dateSerial,
- key,
- },
- },
- })
- }
- />
- )}
-
-
-
-
-
-
- )}
-
-
- (this.numberSetRef = dom)}
- onSet={this.handleSetNumber}
- startNumberInfo={startNumberInfo}
- onChange={this.handleChangeTable}
- onSaveStartNumber={this.handleSubmitStartNumber}
- />
-
-
-
- )}
-
-
- );
- }
-}
diff --git a/pc4mobx/organization/components/resourceNumberSet/index.js b/pc4mobx/organization/components/resourceNumberSet/index.js
deleted file mode 100644
index dda9ed6..0000000
--- a/pc4mobx/organization/components/resourceNumberSet/index.js
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * Author: 黎永顺
- * Description: 岗位编号设置
- * Date: 2022-06-06 09:37:39
- * LastEditTime: 2022-06-07 18:12:11
- */
-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 (
-
-
开启后,可根据设置的人员编号规则自动生成人员编号,涉及场景如下:
-
1.手动新建和手动编辑人员时可选择自动生成和选择预留人员编号;
-
- 2.导入人员类型选择-添加,导入Excel中人员编号为空时,可自动生成人员编号;
-
-
3.人员入职流程中人员编号字段为空时可自动生成人员编号;
-
- );
- };
- render() {
- const { options, subCompanyInfo, loading, startNumberInfo } = this.state;
- const { details, serialenable, dateSerial } = subCompanyInfo;
- const btns = [
-
,
- ];
- const dropMenuDatas = [
- {
- key: "save",
- disabled: false,
- icon:
,
- content: "保存",
- onClick: (key) => this.handleSubmit(),
- },
- ];
- return (
-
-
}
- iconBgcolor="#217346"
- buttons={btns}
- showDropIcon={true}
- dropMenuDatas={dropMenuDatas}
- />
-
-
-
-
- this.setState({
- subCompanyInfo: {
- ...subCompanyInfo,
- serialenable: checkVal,
- },
- })
- }
- />
-
-
- {/* 内容区 */}
- {serialenable === "1" && (
-
-
-
-
-
-
- {!_.isEmpty(options) && (
-
-
-
-
-
-
- this.setState({
- subCompanyInfo: {
- ...subCompanyInfo,
- dateSerial: {
- ...dateSerial,
- enable: isSingle,
- },
- },
- })
- }
- />
- {dateSerial.enable == "1" && (
-
- this.setState({
- subCompanyInfo: {
- ...subCompanyInfo,
- dateSerial: {
- ...dateSerial,
- key,
- },
- },
- })
- }
- />
- )}
-
-
-
-
-
-
- )}
-
-
- (this.numberSetRef = dom)}
- onSet={this.handleSetNumber}
- startNumberInfo={startNumberInfo}
- onChange={this.handleChangeTable}
- onSaveStartNumber={this.handleSubmitStartNumber}
- />
-
-
-
- )}
-
-
- );
- }
-}
diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js
index 917c942..e51c7ef 100644
--- a/pc4mobx/organization/index.js
+++ b/pc4mobx/organization/index.js
@@ -11,10 +11,10 @@ import Sequence from "./components/sequence/Sequence";
import Group from "./components/group/Group";
import OfficeManage from "./components/office/officeManage";
import CompanyExtend from "./components/company/CompanyExtend";
-import BranchNumSetting from "./components/branchNumSetting";
-import DeptNumberSet from "./components/deptNumberSet";
-import PostNumberSet from "./components/postNumberSet";
-import ResourceNumberSet from "./components/resourceNumberSet";
+import BranchNumSetting from "./components/numberSetting/branchNumSetting";
+import DeptNumberSet from "./components/numberSetting/deptNumberSet";
+import PostNumberSet from "./components/numberSetting/postNumberSet";
+import ResourceNumberSet from "./components/numberSetting/resourceNumberSet";
import Company from "./components/company/company";
import StaffScheme from "./components/staff/StaffScheme";
import Staff from "./components/staff/Staff";
diff --git a/pc4mobx/organization/stores/numberSet.js b/pc4mobx/organization/stores/numberSet.js
index 55917a5..6a8610a 100644
--- a/pc4mobx/organization/stores/numberSet.js
+++ b/pc4mobx/organization/stores/numberSet.js
@@ -2,13 +2,74 @@
* Author: 黎永顺
* Description: 编号设置
* Date: 2022-06-07 09:54:46
- * LastEditTime: 2022-06-07 17:00:49
+ * LastEditTime: 2022-06-15 13:09:28
*/
import { observable, action } from "mobx";
+import { WeaForm } from "comsMobx";
+import { WeaTableNew } from "comsMobx";
import * as mobx from "mobx";
import * as API from "../apis/numberSet"; // 引入API接口文件
+const { TableStore } = WeaTableNew;
+
export class NumberSetStore {
+ @observable searchCondition = []; //高级搜索框form数据
+ @observable tableStore = new TableStore(); //列表store
+ @observable form = new WeaForm(); //高级搜索渲染的表单
+ @observable condition = []; //新增职务信息form数据
+ @observable reservedForm = new WeaForm(); //新增预留编号表单
+
+ @action("高级搜索表单渲染")
+ getAdvanceSearchCondition() {
+ API.getAdvanceSearchCondition().then(({ api_status, conditions }) => {
+ if (api_status && !_.isEmpty(conditions)) {
+ this.setSearchCondition(conditions);
+ this.form.initFormFields(conditions);
+ }
+ });
+ }
+
+ @action("获取表格数据")
+ getSearchReservedCodeList(params) {
+ const payload = {
+ ...this.form.getFormParams(),
+ ...params,
+ };
+ API.getSearchReservedCodeList(payload).then(
+ ({ api_status, sessionkey }) => {
+ if (api_status && !_.isEmpty(sessionkey)) {
+ this.tableStore.getDatas(sessionkey, 1);
+ }
+ }
+ );
+ }
+
+ @action("新增预留编号表单查询")
+ getReservedCodeFrom(payload) {
+ return API.getReservedCodeFrom(payload).then(({ api_status, conditioninfo }) => {
+ if (api_status && !_.isEmpty(conditioninfo)) {
+ conditioninfo.map((c) =>
+ c.items.map((item) => {
+ if (item.domkey[0] == "YEAR") {
+ item.value = item.value.toString();
+ }
+ })
+ );
+ this.setCondition(conditioninfo);
+ this.reservedForm.initFormFields(conditioninfo);
+ }
+ });
+ }
+ @action
+ setCondition(condition) {
+ this.condition = condition;
+ }
+
+ @action
+ setSearchCondition(condition) {
+ this.searchCondition = condition;
+ }
+
@action
getCodeSetting(params) {
return API.getCodeSetting(params);
@@ -23,8 +84,19 @@ export class NumberSetStore {
getStartNumForm(params) {
return API.getStartNumForm(params);
}
+
@action
saveStartNum(params) {
return API.saveStartNum(params);
}
-}
+
+ @action("删除预留编号")
+ deleteReservedCodeById(params) {
+ return API.deleteReservedCodeById(params);
+ }
+
+ @action("保存预留编号")
+ saveReservedCode(params) {
+ return API.saveReservedCode(params);
+ }
+}
\ No newline at end of file