Merge pull request 'QC2135695 沃格考勤后端源码改造pc4backstage/hrmAttendance' (#1) from master into 无锡沃格
Reviewed-on: http://221.226.25.34:3000/liang.cheng/weaver_trunk_cli/pulls/1
This commit is contained in:
commit
cd7af2cde1
|
|
@ -11,6 +11,7 @@ import {DialogStore,SearchStore} from '../public/valhalla/stores/index.js';
|
||||||
import isEmpty from 'lodash/isEmpty';
|
import isEmpty from 'lodash/isEmpty';
|
||||||
import cloneDeep from 'lodash/cloneDeep';
|
import cloneDeep from 'lodash/cloneDeep';
|
||||||
import {addContentPath} from '../util/index.js'
|
import {addContentPath} from '../util/index.js'
|
||||||
|
import uuid from 'uuid';
|
||||||
const getLabel = WeaLocaleProvider.getLabel;
|
const getLabel = WeaLocaleProvider.getLabel;
|
||||||
|
|
||||||
const { TableStore } = WeaTableNew;
|
const { TableStore } = WeaTableNew;
|
||||||
|
|
@ -23,6 +24,7 @@ export class HrmShiftManager extends HrmBaseStore {
|
||||||
rightMenus = [];
|
rightMenus = [];
|
||||||
worktimeError = false;//message.error(i18n.label["388878"]());
|
worktimeError = false;//message.error(i18n.label["388878"]());
|
||||||
resttimeError = false;//message.error(i18n.label["388878"]());
|
resttimeError = false;//message.error(i18n.label["388878"]());
|
||||||
|
resttimeRangeError = false;
|
||||||
sTime = ["09:00", "13:00", "19:00"];
|
sTime = ["09:00", "13:00", "19:00"];
|
||||||
eTime = ["12:00", "18:00", "23:00"];
|
eTime = ["12:00", "18:00", "23:00"];
|
||||||
ruleOptions = [];
|
ruleOptions = [];
|
||||||
|
|
@ -145,7 +147,7 @@ export class HrmShiftManager extends HrmBaseStore {
|
||||||
punchsettings: (field, textAreaProps, form, formParams) => null,
|
punchsettings: (field, textAreaProps, form, formParams) => null,
|
||||||
isresttimeopen: (field, textAreaProps, form, formParams) => {
|
isresttimeopen: (field, textAreaProps, form, formParams) => {
|
||||||
const { fieldMap } = form;//mins_next
|
const { fieldMap } = form;//mins_next
|
||||||
if (formParams.shiftonoffworkcount === "1") {
|
if (true/*formParams.shiftonoffworkcount === "1"*/) {
|
||||||
return (
|
return (
|
||||||
<div className="cust">
|
<div className="cust">
|
||||||
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@bhw6l0`}
|
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@bhw6l0`}
|
||||||
|
|
@ -154,7 +156,7 @@ export class HrmShiftManager extends HrmBaseStore {
|
||||||
formParams={formParams}
|
formParams={formParams}
|
||||||
onChange={v => this.calculateWorkTime()}
|
onChange={v => this.calculateWorkTime()}
|
||||||
/>
|
/>
|
||||||
{formParams.isresttimeopen === "1" && (
|
{/* {formParams.isresttimeopen === "1" && (
|
||||||
<div className="child">
|
<div className="child">
|
||||||
<div className="lbl">{fieldMap["restbeigin"].label}</div>
|
<div className="lbl">{fieldMap["restbeigin"].label}</div>
|
||||||
<div className="restTime">
|
<div className="restTime">
|
||||||
|
|
@ -198,7 +200,7 @@ export class HrmShiftManager extends HrmBaseStore {
|
||||||
<div className="restTimeInfo">{i18n.label["388785"]()}</div>
|
<div className="restTimeInfo">{i18n.label["388785"]()}</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)} */}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -956,13 +958,13 @@ export class HrmShiftManager extends HrmBaseStore {
|
||||||
childrenComponents = {
|
childrenComponents = {
|
||||||
shiftonoffworkcount: () => {
|
shiftonoffworkcount: () => {
|
||||||
const formParams = this.formTarget.baseForm.getFormParams();
|
const formParams = this.formTarget.baseForm.getFormParams();
|
||||||
if (formParams.shiftonoffworkcount != "1") {
|
/*if (formParams.shiftonoffworkcount != "1") {
|
||||||
this.formTarget.baseForm.updateFields({
|
this.formTarget.baseForm.updateFields({
|
||||||
isresttimeopen: {
|
isresttimeopen: {
|
||||||
value: "0"
|
value: "0"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}*/
|
||||||
let coms = [], worktimes = this.toJS(this.worktimes);
|
let coms = [], worktimes = this.toJS(this.worktimes);
|
||||||
if (worktimes.length === 0) return [];
|
if (worktimes.length === 0) return [];
|
||||||
for (let i = 1; i <= Number(formParams.shiftonoffworkcount); i++) {
|
for (let i = 1; i <= Number(formParams.shiftonoffworkcount); i++) {
|
||||||
|
|
@ -1104,6 +1106,90 @@ export class HrmShiftManager extends HrmBaseStore {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
isresttimeopen: () => {
|
||||||
|
const formParams = this.formTarget.baseForm.getFormParams();
|
||||||
|
const { fieldMap } = this.formTarget.baseForm;
|
||||||
|
if (formParams.isresttimeopen != "1") {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
const coms = [];
|
||||||
|
this.toJS(this.restTimeCollection).forEach((d, index) => {
|
||||||
|
console.debug(d)
|
||||||
|
const {record, start, end} = d;
|
||||||
|
const {time: sTime = '12:00', accross: sAccross} = start || {};
|
||||||
|
const {time: eTime, accross: eAccross} = end || {};
|
||||||
|
coms.push(
|
||||||
|
<WeaFormItem
|
||||||
|
label={`${fieldMap['isresttimeopen'].label}${index + 1}`}
|
||||||
|
labelCol={{ span: this.custLabelCol }}
|
||||||
|
wrapperCol={{ span: 24 - this.custLabelCol }}
|
||||||
|
>
|
||||||
|
<div className="cust">
|
||||||
|
<div className="child">
|
||||||
|
<div className="lbl">{fieldMap["restbeigin"].label}</div>
|
||||||
|
<div className="restTime">
|
||||||
|
<WeaError tipPosition='bottom'
|
||||||
|
ref={d => this.errRefs[`restbeigin${index}`] = d}
|
||||||
|
error={`"${fieldMap["restbeigin"].label}" ${i18n.message.dataEmpty()}`}>
|
||||||
|
<WeaTimePicker
|
||||||
|
value={sTime}
|
||||||
|
onChange={v => {
|
||||||
|
this.restTimeCollection[index].start.time = v;
|
||||||
|
this.calculateWorkTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</WeaError>
|
||||||
|
</div>
|
||||||
|
{
|
||||||
|
sAccross == '1' &&
|
||||||
|
<div className="restTimeInfo">{i18n.label["388785"]()}</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div className="child">
|
||||||
|
<div className="lbl">{fieldMap["restend"].label}</div>
|
||||||
|
<div className="restTime">
|
||||||
|
<WeaError tipPosition='bottom'
|
||||||
|
ref={d => this.errRefs[`restend${index}`] = d}
|
||||||
|
error={`"${fieldMap["restend"].label}" ${i18n.message.dataEmpty()}`}>
|
||||||
|
<WeaTimePicker
|
||||||
|
value={eTime}
|
||||||
|
onChange={v =>{
|
||||||
|
this.restTimeCollection[index].end.time = v;
|
||||||
|
this.calculateWorkTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</WeaError>
|
||||||
|
</div>
|
||||||
|
{
|
||||||
|
eAccross == '1' &&
|
||||||
|
<div className="restTimeInfo">{i18n.label["388785"]()}</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div className="child">
|
||||||
|
<a onClick={() => this.deleteRest(index)}>
|
||||||
|
{i18n.label.delete()}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</WeaFormItem>
|
||||||
|
);
|
||||||
|
})
|
||||||
|
coms.push(
|
||||||
|
(
|
||||||
|
<div className="addRule">
|
||||||
|
<a onClick={() => this.onAddrest()}>{i18n.label["388877"]()}</a>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
com: <div>{coms}</div>,
|
||||||
|
col: 1
|
||||||
|
}
|
||||||
|
];
|
||||||
|
},
|
||||||
earlyinearlyout: () => {
|
earlyinearlyout: () => {
|
||||||
const formParams = this.formTarget.settingForm.getFormParams();
|
const formParams = this.formTarget.settingForm.getFormParams();
|
||||||
let coms = [];
|
let coms = [];
|
||||||
|
|
@ -1530,6 +1616,8 @@ export class HrmShiftManager extends HrmBaseStore {
|
||||||
};
|
};
|
||||||
|
|
||||||
@observable timeErrorType = 1;
|
@observable timeErrorType = 1;
|
||||||
|
|
||||||
|
@observable restTimeCollection = [];
|
||||||
/********************* observable list *********************/
|
/********************* observable list *********************/
|
||||||
|
|
||||||
/********************* computed list *********************/
|
/********************* computed list *********************/
|
||||||
|
|
@ -1544,6 +1632,21 @@ export class HrmShiftManager extends HrmBaseStore {
|
||||||
/********************* computed list *********************/
|
/********************* computed list *********************/
|
||||||
|
|
||||||
/********************* action list *********************/
|
/********************* action list *********************/
|
||||||
|
@action onAddrest = () => {
|
||||||
|
this.restTimeCollection.push({
|
||||||
|
record: uuid(),
|
||||||
|
start: {time: '', accross: '0'},
|
||||||
|
end: {time: '', accross: '0'}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.calculateWorkTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
@action deleteRest = index => {
|
||||||
|
this.restTimeCollection.splice(index, 1);
|
||||||
|
this.calculateWorkTime();
|
||||||
|
}
|
||||||
|
|
||||||
setRuleOptions = () => {
|
setRuleOptions = () => {
|
||||||
this.ruleOptions.length = 0;
|
this.ruleOptions.length = 0;
|
||||||
for (let i = 0; i < 10; i++) {
|
for (let i = 0; i < 10; i++) {
|
||||||
|
|
@ -1663,6 +1766,7 @@ export class HrmShiftManager extends HrmBaseStore {
|
||||||
this.processCondition(data);
|
this.processCondition(data);
|
||||||
this.canAdd = data.canAdd;
|
this.canAdd = data.canAdd;
|
||||||
this.shift_24 = data.shift_24 || 0;
|
this.shift_24 = data.shift_24 || 0;
|
||||||
|
this.restTimeCollection = data.restTimeSections;
|
||||||
this.setFormData("baseForm", data.condition);
|
this.setFormData("baseForm", data.condition);
|
||||||
if (this.formTarget.baseForm.isFormInit) {
|
if (this.formTarget.baseForm.isFormInit) {
|
||||||
callback && callback();
|
callback && callback();
|
||||||
|
|
@ -1865,6 +1969,30 @@ export class HrmShiftManager extends HrmBaseStore {
|
||||||
return this.restTimeSections[1].across == '1';
|
return this.restTimeSections[1].across == '1';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkRestTimeCollection = (times) => {
|
||||||
|
this.resttimeRangeError = false;
|
||||||
|
if(times.length <= 1)
|
||||||
|
return this.resttimeRangeError;
|
||||||
|
const obj = times.reduce((current, next) => {
|
||||||
|
const {s, e} = next;
|
||||||
|
current.start.push(s.format('YYYY-MM-DD HH:mm:ss'));
|
||||||
|
current.end.push(e.format('YYYY-MM-DD HH:mm:ss'));
|
||||||
|
return current;
|
||||||
|
}, {start: [], end: []});
|
||||||
|
let {start, end} = obj;
|
||||||
|
start = start.sort();
|
||||||
|
end = end.sort();
|
||||||
|
|
||||||
|
for(let i = 1; i < start.length; i++){
|
||||||
|
if (start[i] <= end[i - 1]){
|
||||||
|
message.error(getLabel('523624','休息时间不能重叠'));
|
||||||
|
this.resttimeRangeError = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.resttimeRangeError;
|
||||||
|
}
|
||||||
|
|
||||||
calculateWorkTime = () => {
|
calculateWorkTime = () => {
|
||||||
this.resttimeError = false;
|
this.resttimeError = false;
|
||||||
this.timeRange = 0;
|
this.timeRange = 0;
|
||||||
|
|
@ -1873,81 +2001,96 @@ export class HrmShiftManager extends HrmBaseStore {
|
||||||
minute = 0;
|
minute = 0;
|
||||||
try {
|
try {
|
||||||
const d = this.toJS(this.worktimes);
|
const d = this.toJS(this.worktimes);
|
||||||
if (d.length === 1) {
|
let firstS;
|
||||||
let record = d[0];
|
let lastE;
|
||||||
|
d.map((record, i) => {
|
||||||
let s = this.convertTimeToMoment(record.start.times),
|
let s = this.convertTimeToMoment(record.start.times),
|
||||||
e = this.convertTimeToMoment(record.end.times);
|
e = this.convertTimeToMoment(record.end.times);
|
||||||
if (record.start.across === '1' && record.end.across === '1') {
|
i == 0 && (firstS = s);
|
||||||
} else if (record.end.across === '1') {
|
if (record.start.across === "1" && record.end.across === "1") {
|
||||||
|
} else if (record.end.across === "1") {
|
||||||
e.add(1, "d");
|
e.add(1, "d");
|
||||||
}
|
}
|
||||||
minute = Math.abs(s.diff(e, "m"));
|
i == d.length - 1 && (lastE = e);
|
||||||
if (formParams.isresttimeopen === "1") {
|
minute += Math.abs(s.diff(e, "m"));
|
||||||
|
});
|
||||||
|
if (formParams.isresttimeopen === "1") {
|
||||||
|
const times = [];
|
||||||
|
const wst = this.convertTimeToMoment(this.worktimes[0].start.times),
|
||||||
|
wet = this.convertTimeToMoment(this.worktimes[this.worktimes.length - 1].end.times);
|
||||||
|
if(this.worktimes[this.worktimes.length - 1].end.across == '1')
|
||||||
|
wet.add(1, 'd');
|
||||||
|
|
||||||
|
this.restTimeCollection = this.toJS(this.restTimeCollection).map((d, index) => {
|
||||||
|
const {start, end} = d;
|
||||||
|
const {time: restbeigin = ''} = start || {};
|
||||||
|
const {time: restend = ''} = end || {};
|
||||||
let sAcross = '0', eAcross = '0';
|
let sAcross = '0', eAcross = '0';
|
||||||
const { restbeigin, restend } = formParams;
|
|
||||||
if (restbeigin != "" && restend != "") {
|
if (restbeigin != "" && restend != "") {
|
||||||
const rst = this.convertTimeToMoment(restbeigin),
|
const rst = this.convertTimeToMoment(restbeigin),
|
||||||
ret = this.convertTimeToMoment(restend),
|
ret = this.convertTimeToMoment(restend);
|
||||||
wst = this.convertTimeToMoment(this.worktimes[0].start.times),
|
|
||||||
wet = this.convertTimeToMoment(this.worktimes[0].end.times);
|
if(index != 0){
|
||||||
this.worktimes[0].end.across === '1' && wet.add(1, "d");
|
let lastRecord = this.restTimeCollection[index - 1];
|
||||||
if(rst.isBefore(wst)){
|
let le = this.convertTimeToMoment(lastRecord.end.time);
|
||||||
sAcross = '1';
|
d.start.accross = rst.isBefore(le) ? '1' : lastRecord.end.across;
|
||||||
rst.add(1, 'd');
|
}else{
|
||||||
ret.add(1, 'd');
|
d.start.accross = rst.isBefore(wst) ? '1' : '0';
|
||||||
}
|
|
||||||
if(ret.isBefore(rst)){
|
|
||||||
eAcross = '1';
|
|
||||||
ret.add(1, 'd');
|
|
||||||
}
|
}
|
||||||
|
d.end.accross = ret.isBefore(rst) ? '1' : d.start.accross;
|
||||||
|
|
||||||
|
console.debug(d)
|
||||||
|
|
||||||
|
d.start.accross == '1' && rst.add(1, 'd');
|
||||||
|
d.end.accross == '1' && ret.add(1, 'd');
|
||||||
|
|
||||||
|
times.push({s: rst, e: ret});
|
||||||
|
|
||||||
if (
|
if (
|
||||||
rst.isBefore(wst) ||
|
rst.isBefore(wst) ||
|
||||||
rst.isAfter(wet) ||
|
rst.isAfter(wet) ||
|
||||||
ret.isBefore(wst) ||
|
ret.isBefore(wst) ||
|
||||||
ret.isAfter(wet) ||
|
ret.isAfter(wet) ||
|
||||||
rst.isSame(ret)
|
rst.isSame(ret)
|
||||||
) {
|
){
|
||||||
this.resttimeError = true;
|
this.resttimeError = true;
|
||||||
} else {
|
message.error('休息时间不在工作时段内');
|
||||||
if (ret.isBefore(rst)) ret.add(1, "d");
|
|
||||||
|
if(!rst.isSame(ret)) {
|
||||||
|
this.toJS(this.worktimes).forEach((worktime) => {
|
||||||
|
const s = this.convertTimeToMoment(worktime.start.times);
|
||||||
|
worktime.start.across == '1' && s.add(1, 'd');
|
||||||
|
|
||||||
|
const e = this.convertTimeToMoment(worktime.end.times);
|
||||||
|
worktime.end.across == '1' && e.add(1, 'd');
|
||||||
|
|
||||||
|
let ts = rst, te = ret;
|
||||||
|
if(ts.isBefore(s))
|
||||||
|
ts = s;
|
||||||
|
else if(ts.isAfter(e)){
|
||||||
|
ts = e;
|
||||||
|
}
|
||||||
|
if(te.isAfter(e))
|
||||||
|
te = e;
|
||||||
|
|
||||||
|
minute -= Math.abs(ts.diff(te, "m"));
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}else{
|
||||||
minute -= Math.abs(rst.diff(ret, "m"));
|
minute -= Math.abs(rst.diff(ret, "m"));
|
||||||
}
|
}
|
||||||
this.restTimeSections = [
|
|
||||||
{
|
|
||||||
resttype: "start",
|
|
||||||
time: restbeigin,
|
|
||||||
across: sAcross
|
|
||||||
},
|
|
||||||
{
|
|
||||||
resttype: "end",
|
|
||||||
time: restend,
|
|
||||||
across: (sAcross == '1' ? '1' : eAcross)
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
}
|
return d;
|
||||||
this.hour = Math.floor(minute / 60);
|
|
||||||
this.minute = minute % 60;
|
|
||||||
} else {
|
|
||||||
let firstS;
|
|
||||||
let lastE;
|
|
||||||
d.map((record, i) => {
|
|
||||||
let s = this.convertTimeToMoment(record.start.times),
|
|
||||||
e = this.convertTimeToMoment(record.end.times);
|
|
||||||
i == 0 && (firstS = s);
|
|
||||||
if (record.start.across === '1' && record.end.across === '1') {
|
|
||||||
} else if (record.end.across === '1') {
|
|
||||||
e.add(1, "d");
|
|
||||||
}
|
|
||||||
i == (d.length - 1) && (lastE = e);
|
|
||||||
minute += Math.abs(s.diff(e, "m"));
|
|
||||||
});
|
});
|
||||||
this.hour = Math.floor(minute / 60);
|
this.checkRestTimeCollection(times);
|
||||||
this.minute = minute % 60;
|
|
||||||
this.timeRange = Math.abs(firstS.diff(lastE, "m"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.worktime = minute;
|
this.worktime = minute;
|
||||||
} catch (ex) {}
|
this.hour = Math.floor(minute / 60);
|
||||||
|
this.minute = minute % 60;
|
||||||
|
} catch (ex) {
|
||||||
|
console.error(ex)
|
||||||
|
}
|
||||||
let result = i18n.label["388788"]().replace("{hour}", hour);
|
let result = i18n.label["388788"]().replace("{hour}", hour);
|
||||||
result = result.replace("{minute}", minute);
|
result = result.replace("{minute}", minute);
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -2179,15 +2322,15 @@ export class HrmShiftManager extends HrmBaseStore {
|
||||||
const formParams = this.formTarget.baseForm.getFormParams();
|
const formParams = this.formTarget.baseForm.getFormParams();
|
||||||
window.e9HideFormFieldKeys = [];
|
window.e9HideFormFieldKeys = [];
|
||||||
const{shiftonoffworkcount, isresttimeopen, cardRemind,cardRemOfSignIn,cardRemOfSignOut, halfcalrule}=formParams;
|
const{shiftonoffworkcount, isresttimeopen, cardRemind,cardRemOfSignIn,cardRemOfSignOut, halfcalrule}=formParams;
|
||||||
if (
|
/*if (
|
||||||
shiftonoffworkcount != null &&
|
shiftonoffworkcount != null &&
|
||||||
(shiftonoffworkcount != "1" ||
|
(shiftonoffworkcount != "1" ||
|
||||||
(shiftonoffworkcount === "1" &&
|
(shiftonoffworkcount === "1" &&
|
||||||
isresttimeopen &&
|
isresttimeopen &&
|
||||||
isresttimeopen != "1"))
|
isresttimeopen != "1"))
|
||||||
) {
|
) {*/
|
||||||
window.e9HideFormFieldKeys.push(...["restbeigin", "restend"]);
|
window.e9HideFormFieldKeys.push(...["restbeigin", "restend"]);
|
||||||
}
|
//}
|
||||||
if(halfcalrule == '0'){
|
if(halfcalrule == '0'){
|
||||||
['halfcalpoint','halfcalpoint2cross'].forEach(key=>{
|
['halfcalpoint','halfcalpoint2cross'].forEach(key=>{
|
||||||
window.e9HideFormFieldKeys.push(key);
|
window.e9HideFormFieldKeys.push(key);
|
||||||
|
|
@ -2237,10 +2380,45 @@ export class HrmShiftManager extends HrmBaseStore {
|
||||||
this.spinning = false;
|
this.spinning = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(this.resttimeError){
|
if(/*shiftonoffworkcount == "1" &&*/ isresttimeopen == '1'){
|
||||||
message.error(i18n.label["390303"]());
|
if(this.resttimeError){
|
||||||
this.spinning = false;
|
message.error('休息时间不在工作时段内');
|
||||||
return;
|
this.spinning = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.resttimeRangeError){
|
||||||
|
message.error(getLabel('523624','休息时间不能重叠'));
|
||||||
|
this.spinning = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// if(this.resttimeError){
|
||||||
|
// message.error(i18n.label["390303"]());
|
||||||
|
// this.spinning = false;
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
const arr = this.toJS(this.restTimeCollection);
|
||||||
|
if(arr.length == 0){
|
||||||
|
message.error(getLabel('523634','请设置休息时间'));
|
||||||
|
this.spinning = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const rIndex = [];
|
||||||
|
arr.map((d, i) => {
|
||||||
|
const {start, end} = d;
|
||||||
|
const {time: restbeigin = ''} = start || {};
|
||||||
|
const {time: restend = ''} = end || {};
|
||||||
|
const flag = (restbeigin == '' || restend == '');
|
||||||
|
flag && rIndex.push(i);
|
||||||
|
restbeigin == '' && this.errRefs[`restbeigin${i}`] && this.errRefs[`restbeigin${i}`].showError();
|
||||||
|
restend == '' && this.errRefs[`restend${i}`] && this.errRefs[`restend${i}`].showError();
|
||||||
|
})
|
||||||
|
if(rIndex.length > 0){
|
||||||
|
this.spinning = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(halfcalrule == '1'){
|
if(halfcalrule == '1'){
|
||||||
const {halfcalpoint, halfcalpoint2cross} = data;
|
const {halfcalpoint, halfcalpoint2cross} = data;
|
||||||
|
|
@ -2256,7 +2434,10 @@ export class HrmShiftManager extends HrmBaseStore {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
data.restTimeSections = this.toJS(this.restTimeSections);
|
// data.restTimeSections = this.toJS(this.restTimeSections);
|
||||||
|
data.restTimeSections = this.toJS(this.restTimeCollection).map((d, i) => {
|
||||||
|
return {...d, orderId: i}
|
||||||
|
});
|
||||||
|
|
||||||
const params = { data: JSON.stringify(data) };
|
const params = { data: JSON.stringify(data) };
|
||||||
api.saveShiftManagementBaseForm(params).then(
|
api.saveShiftManagementBaseForm(params).then(
|
||||||
|
|
@ -2313,7 +2494,8 @@ export class HrmShiftManager extends HrmBaseStore {
|
||||||
this.canAdd = data.canAdd;
|
this.canAdd = data.canAdd;
|
||||||
this.shift_24 = data.shift_24 || 0;
|
this.shift_24 = data.shift_24 || 0;
|
||||||
this.setFormData("baseForm", data.condition);
|
this.setFormData("baseForm", data.condition);
|
||||||
workSections = data.workSections;
|
workSections = data.workSections || [];
|
||||||
|
this.restTimeCollection = data.restTimeSections
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
data.condition[0].items.map(item => (item.colSpan = 2));
|
data.condition[0].items.map(item => (item.colSpan = 2));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue