gaoshp
2024-11-05 e2fdfe540eaf160dc7d063c60667041edcc64e86
src/views/console/base/Dialog.vue
@@ -154,8 +154,9 @@
                shiftNumber: params?.shiftNumber || this?.detail?.paramValue - 0,
                number: params?.number || 1
            }
            console.log(this?.detail?.paramValue, '?????????????//')
            if (params?.shiftDetailVOList?.length > 0) {
                this.shiftDetailDTOList = params?.shiftDetailVOList?.map((item, index) => {
                    let shiftRestTimeDTOList = item?.shiftRestTimeVOList.map(item => {
                        return {
@@ -181,6 +182,40 @@
                    }
                })
                if (params?.shiftDetailVOList?.length < this?.detail?.paramValue) {
                    for (let i = 0; i < this?.detail?.paramValue - params?.shiftDetailVOList?.length; i++) {
                        this.shiftDetailDTOList.push({
                            range: [0, 0],
                            shiftStartTime: 0,
                            shiftEndTime: 0,
                            shiftIndex: i + 1,
                            indexName: '',
                            restNumber: i + 1,
                            shiftRestTimeDTOList: [
                                {
                                    range: [0, 0],
                                    restStartTime: 0,
                                    restEndTime: 0,
                                },
                                {
                                    range: [0, 0],
                                    restStartTime: 0,
                                    restEndTime: 0,
                                },
                                {
                                    range: [0, 0],
                                    restStartTime: 0,
                                    restEndTime: 0,
                                },
                                {
                                    range: [0, 0],
                                    restStartTime: 0,
                                    restEndTime: 0,
                                }
                            ]
                        })
                    }
                }
            } else {
                let len = this?.detail?.paramValue - 0 || 1
                let shiftDetailDTOList = []
@@ -260,11 +295,11 @@
                    let res
                    try {
                        if (this.form.id) {
                            res = await this.$HTTP.put('/api/blade-cps/shift', data).catch(() => {
                            res = await this.$HTTP.put('/api/smis/shift', data).catch(() => {
                                throw new Error()
                            })
                        } else {
                            res = await this.$HTTP.post('/api/blade-cps/shift', data).catch(() => {
                            res = await this.$HTTP.post('/api/smis/shift', data).catch(() => {
                                throw new Error()
                            })
                        }
@@ -278,7 +313,7 @@
                        this.visible = false;
                        this.$message.success("操作成功")
                    } else {
                        this.$alert(res.message, "提示", { type: 'error' })
                        this.$alert(res.msg, "提示", { type: 'error' })
                    }
                } else {
                    return false;