lzhe
2024-10-01 fee1948081e9cecc1de29ee5029f737aef2dcb38
Merge branch 'release' of http://122.9.151.159:9090/r/smart-web into release
已修改2个文件
59 ■■■■ 文件已修改
src/views/console/base/Add.vue 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/console/base/CalenderTab.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/console/base/Add.vue
@@ -1,8 +1,8 @@
<!--
 * @Date: 2024-05-04 16:37:48
 * @LastEditors: Sneed
 * @LastEditTime: 2024-05-05 21:02:54
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/console/base/Add.vue
 * @LastEditors: gaoshp
 * @LastEditTime: 2024-10-01 20:21:11
 * @FilePath: /cps-web/src/views/console/base/Add.vue
-->
<template>
    <el-container>
@@ -23,7 +23,7 @@
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="应用年份" prop="year">
                                <el-select v-model="form.year" placeholder="" size="" @change="change">
                                <el-select v-model="form.year" placeholder="" size="" @change="changeYear">
                                    <el-option v-for="item in options" :key="item.value" :label="item.label"
                                        :value="item.value" />
                                </el-select>
@@ -196,16 +196,31 @@
        }
    },
    watch: {
        holiday() {
            this.setDay()
        },
        checkboxGroup1() {
            this.setDay()
        },
        dateDTOList(val) {
            this.months.forEach(month => {
                if (val.length > 0) {
                    month.attributes[1].highlight = 'yellow'
                } else {
                    month.attributes[1].highlight = true
                }
            })
        },
        'form.year'(val) {
            this.months = []
            let currentYear = moment(val, 'YYYY').format('YYYY') - 0
            this.form.date = [`${currentYear}-01-01`, `${currentYear}-12-31`]
            if (currentYear == moment().format('YYYY')) {
                this.form.date[0] = moment().format('YYYY-MM-DD')
            }
            // console.log(this.months)
            this.$HTTP.post('/api/blade-cps/shift-off-day/list', {
                year: currentYear,
@@ -228,7 +243,7 @@
                        year: currentYear,
                        month: i,
                        id: `${currentYear}${i}`,
                        min: new Date('2024-01-01'),
                        min: new Date(`${currentYear}-01-01`),
                        attributes: [
                            {
                                dot: 'yellow',
@@ -284,7 +299,7 @@
            let currentYear = moment(this.form.year, 'YYYY').format('YYYY') - 0
            this.months.forEach((item, i) => {
                let start = moment(`${currentYear}-${i + 1}-01`)
                let end = moment(`${currentYear}-${i + 2}-01`)
                let end = i == 11 ? moment(`${currentYear + 1}-${i + 1}-01`) : moment(`${currentYear}-${i + 2}-01`)
                let dates = []
                console.log(start.format('YYYY-MM-DD'), start.unix() >= moment(this.form.date[0]).unix() && start.unix() <= moment(this.form.date[1]).unix())
                while (start.unix() < end.unix()) {
@@ -302,6 +317,7 @@
                    start.add(1, 'd')
                }
                this.months[i].attributes[1].dates = dates
                console.log(this.months, 'jieguo')
            })
        },
        pushDate(start) {
@@ -322,7 +338,11 @@
            console.log(index, item.attributes[1].dates)
        },
        plan() {
            if (!this.modelId) {
                return this.$message.warning('请选择班次方案');
            }
            let dateDTOList = this.months.map(item => item.attributes[1].dates)
            console.log(this.months, '>>>>>>>>>>', dateDTOList.flat(2))
            let list = dateDTOList.flat(2).map(v => {
                return {
                    modelId: this.modelId,
@@ -343,7 +363,7 @@
            }
        },
        planCancel() {
            this.dateDTOList = []
        },
        save() {
            this.$refs.dialogForm.validate(async (valid) => {
@@ -367,6 +387,8 @@
                        }
                    })
                    console.log(this.form, this.dateDTOList)
                } else {
                    this.$message.warning('请检查必填项');
                }
            })
        }
src/views/console/base/CalenderTab.vue
@@ -1,8 +1,8 @@
<!--
 * @Date: 2024-04-04 22:45:43
 * @LastEditors: gaosp
 * @LastEditTime: 2024-09-07 15:15:29
 * @FilePath: /mdc/Users/mache/Documents/demo/cps-web/src/views/console/base/CalenderTab.vue
 * @LastEditors: gaoshp
 * @LastEditTime: 2024-10-01 20:16:51
 * @FilePath: /cps-web/src/views/console/base/CalenderTab.vue
-->
<template>
    <el-container>
@@ -29,6 +29,9 @@
                </el-popconfirm>
            </el-header>
            <el-main>
                <el-row :gutter="12" v-show="shiftListName">
                    {{ shiftListName }}
                </el-row>
                <el-row>
                    <el-col :span="6" style="padding:  10px;" v-for="item in months" :key="item.month">
                        <Calendar :initial-page="{ month: item.month + 1, year: item.year }" :rows="1"
@@ -39,8 +42,9 @@
            </el-main>
        </el-container>
        <el-drawer v-model="drawer" size="80%" title="生产日历" :direction="direction" :before-close="handleClose">
            <Add :shiftList="shiftList" @success="success"></Add>
        <el-drawer v-if="drawer" v-model="drawer" size="80%" title="生产日历" :direction="direction"
            :before-close="handleClose">
            <Add v-if="drawer" :shiftList="shiftList" @success="success"></Add>
        </el-drawer>
        <el-drawer v-model="raworkVisible" size="80%" title="生产日历" :direction="direction" :before-close="handleClose">
            <el-container v-if="raworkVisible">
@@ -71,6 +75,7 @@
    data() {
        return {
            shiftList: [],
            shiftListName: '',
            selectInfo: {},
            drawer: false,
            months: [],
@@ -191,6 +196,14 @@
                if (res.code === 200) {
                    console.log(res.data)
                    this.setDay(res.data)
                    let current = this.shiftList.find(v => v.id == res.data.calendarDayVOList[0].modelId)
                    console.log('////', this.shiftList, res.data.calendarDayVOList[0].id)
                    if (current) {
                        this.shiftListName = `${current.code}-${current.name}`
                    } else {
                        this.shiftListName = ''
                    }
                }
            })
        },