fix: changestatus

mgy
Dawn1Ocean 2024-05-10 11:14:23 +08:00
parent 96dc81bd82
commit fc9347e7c1
3 changed files with 7 additions and 17 deletions

View File

@ -343,7 +343,7 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
}
handleStatusChange(status: number): void {
if (status == 3 || status == 5 || status == 7) {
if (status >= 3 && status <= 7) {
this.setState({
isDisable: {
...this.state.isDisable,
@ -376,8 +376,10 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
status: false,
},
},
// eslint-disable-next-line react/no-unused-state
statusToBe: status,
});
changeStatus(this);
changeStatus(this, status);
}
setTimeout(() => {
this.setState({
@ -427,7 +429,7 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
},
},
});
changeStatus(this);
changeStatus(this, this.state.statusToBe);
} else {
this.setState({
isDisable: {

View File

@ -1,8 +1,4 @@
export interface MainPageText {
normal: {
recoverTime: string;
reason: string;
};
askLeave: string;
conclusion: string;
titleLine: {
@ -46,10 +42,6 @@ export interface MainPageText {
}
export const mainPageZhCn: MainPageText = {
normal: {
recoverTime: '明天 13:30',
reason: '正常下班',
},
askLeave: '我要请假',
conclusion: '提交值班总结',
titleLine: {
@ -117,10 +109,6 @@ export const mainPageZhCn: MainPageText = {
};
export const mainPageEnUs: MainPageText = {
normal: {
recoverTime: 'Tomorrow 13:30',
reason: 'Normal shift',
},
askLeave: 'Absence',
conclusion: 'Submit Duty Conclusion',
titleLine: {

View File

@ -6,7 +6,7 @@ import { getUrl } from '.';
const reLaunchInterval = 1000;
export function changeStatus(that: TicketDetail) {
export function changeStatus(that: TicketDetail, status: number) {
that.setState({
isLoading: {
...that.state.isLoading,
@ -19,7 +19,7 @@ export function changeStatus(that: TicketDetail) {
data: {
token: wechatUser.getToken(),
id: that.state.id,
status: that.state.statusToBe,
status: status,
},
})
.then((res) => {