Browse Source

设施环境使用默认数据逻辑调整;增加按时间间隔监测选项

luoaoxuan 1 year ago
parent
commit
4d28865487

+ 675 - 0
src/views/system/fasc/defaultSettingDialog.vue

@@ -0,0 +1,675 @@
+<template>
+    <el-dialog
+        title="配置默认数据"
+        :visible.sync="dialogVisible"
+        width="60%"
+        append-to-body
+        class="dialog"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        :show-close="false"
+    >
+        <div class="contain">
+            <div class="form">
+                <el-form ref="subformRef" :model="form" label-width="100px">
+                    <el-row :gutter="20">
+                        <el-col :span="12">
+                            <el-form-item label="默认部门:">
+                                <ibps-user-selector
+                                    v-model="form.bian_zhi_bu_men_"
+                                    size="mini"
+                                    type="position"
+                                    readonly-text="text"
+                                    :disabled="false"
+                                    :multiple="false"
+                                    style="width:100%"
+                                    :filter="filter"
+                                    filterable
+                                />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="12">
+                            <el-form-item label="默认岗位:">
+                                <el-select v-model="form.gang_wei_" placeholder="请选择" size="mini" style="width:100%">
+                                    <el-option
+                                        v-for="item in jianCeGangWeiList"
+                                        :key="item.id_"
+                                        :label="item.wei_hu_gang_wei_"
+                                        :value="item.wei_hu_gang_wei_"
+                                    />
+                                </el-select>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row :gutter="20">
+                        <el-col :span="12">
+                            <el-form-item label="默认周期:">
+                                <el-select v-model="form.zhou_qi_" placeholder="请选择" size="mini" style="width:100%">
+                                    <el-option
+                                        v-for="item in period"
+                                        :key="item.value"
+                                        :label="item.label"
+                                        :value="item.value"
+                                    />
+                                </el-select>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row v-if="form.zhou_qi_!==''" :gutter="20">
+                        <el-col :span="12">
+                            <el-form-item :label="labelShow">
+                                <el-checkbox-group v-if="form.zhou_qi_==='每日'" v-model="dayCheck" style="width:100%">
+                                    <el-checkbox v-for="item in weekDays" :key="item.value" :label="item.value" size="mini">{{ item.label }}</el-checkbox>
+                                </el-checkbox-group>
+                                <template v-if="form.zhou_qi_==='每周'">
+                                    <div class="radio" style="width:100%">
+                                        <el-radio v-for="item in weekDays" :key="item.value" v-model="weekCheck" :label="item.value" size="mini">{{ item.label }}</el-radio>
+                                    </div>
+                                </template>
+                                <el-select v-if="form.zhou_qi_==='每月'" v-model="monthCheck" placeholder="请选择" size="mini" style="width:100%">
+                                    <el-option
+                                        v-for="item in 28"
+                                        :key="item"
+                                        :label="`第${item}天`"
+                                        :value="item"
+                                    />
+                                </el-select>
+                                <el-select v-if="form.zhou_qi_==='每季度'" v-model="quarterCheck" placeholder="请选择" size="mini" style="width:100%">
+                                    <el-option
+                                        v-for="item in 3"
+                                        :key="item"
+                                        :label="`第${item}个月`"
+                                        :value="item"
+                                    />
+                                </el-select>
+                                <el-select v-if="form.zhou_qi_==='每半年'" v-model="halfYearCheck" placeholder="请选择" size="mini" style="width:100%">
+                                    <el-option
+                                        v-for="item in 6"
+                                        :key="item"
+                                        :label="`第${item}个月`"
+                                        :value="item"
+                                    />
+                                </el-select>
+                                <el-select v-if="form.zhou_qi_==='每年'" v-model="yearCheck" placeholder="请选择" size="mini" style="width:100%">
+                                    <el-option
+                                        v-for="item in 12"
+                                        :key="item"
+                                        :label="`第${item}个月`"
+                                        :value="item"
+                                    />
+                                </el-select>
+                                <el-select v-if="form.zhou_qi_==='间隔'" v-model="sepCheck" placeholder="请选择" size="mini" style="width:100%">
+                                    <el-option
+                                        v-for="item in 30"
+                                        :key="item"
+                                        :label="`每隔${item}天`"
+                                        :value="item"
+                                    />
+                                </el-select>
+                            </el-form-item>
+
+                        </el-col>
+                        <el-col v-if="nextDate" :span="12">
+                            <el-form-item label="下次监测日期为:" label-width="150">
+                                <el-tag>{{ nextDate }}</el-tag>
+                            </el-form-item>
+                        </el-col>
+                        <el-col v-if="form.zhou_qi_==='间隔'" :span="12">
+                            <el-form-item label="开始监测时间:" prop="">
+                                <el-date-picker
+                                    v-model="form.kai_shi_shi_jian_"
+                                    :clearable="false"
+                                    type="date"
+                                    placeholder="选择查询的月份"
+                                    :picker-options="pickerOptions"
+                                    value-format="yyyy-MM-dd"
+                                    size="mini"
+                                    style="width:100%"
+                                />
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row :gutter="20">
+                        <el-col :span="12">
+                            <el-form-item label="默认控制条件:">
+                                <el-input v-model="form.tiao_jian_" type="textarea" :rows="2" size="mini" style="width:100%" />
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row :gutter="20">
+                        <el-col :span="24">
+                            <FacilityData v-if="form.lie_biao_shu_ju_" :form-data="{lieBiaoShuJu:form.lie_biao_shu_ju_}" :is-cul="false" @change-data="onFacilityData" />
+                        </el-col>
+                    </el-row>
+                </el-form>
+
+            </div>
+        </div>
+        <span slot="footer" class="dialog-footer">
+            <el-button size="mini" type="info" icon="el-icon-setting" @click="emitParent('settingEmpty')">为空替换</el-button>
+            <el-button size="mini" type="info" icon="el-icon-setting" @click="emitParent('settingAll')">全部替换</el-button>
+            <el-button size="mini" type="danger" icon="ibps-icon-close" @click="handleClose">取消</el-button>
+        </span>
+    </el-dialog>
+</template>
+
+<script>
+import ibpsUserSelector from '@/business/platform/org/selector'
+import FacilityData from '@/views/component/facility/facilityData.vue'
+export default {
+    components: {
+        FacilityData, ibpsUserSelector
+    },
+    props: {
+        dialogVisible: {
+            type: Boolean,
+            default: false
+        },
+        params: {
+            type: Object,
+            default: () => ({})
+        },
+        jianCeGangWeiList: {
+            type: Array,
+            default: () => []
+        },
+        day: {
+            type: Array,
+            default: () => []
+        },
+        week: {
+            type: String,
+            default: ''
+        },
+        month: {
+            type: String,
+            default: ''
+        },
+        quarter: {
+            type: String,
+            default: ''
+        },
+        halfYear: {
+            type: String,
+            default: ''
+        },
+        year: {
+            type: String,
+            default: ''
+        },
+        sep: {
+            type: String,
+            default: ''
+        }
+    },
+    data () {
+        return {
+            pickerOptions: {
+                disabledDate (time) {
+                    return time.getTime() < (Date.now() - (24 * 60 * 1000 * 60))
+                }
+            },
+            dayCheck: [],
+            weekCheck: '',
+            monthCheck: '',
+            quarterCheck: '',
+            halfYearCheck: '',
+            yearCheck: '',
+            sepCheck: '',
+            weekDays: [{ label: '周一', value: 1 }, { label: '周二', value: 2 }, { label: '周三', value: 3 }, { label: '周四', value: 4 }, { label: '周五', value: 5 }, { label: '周六', value: 6 }, { label: '周日', value: 7 }],
+            nextDate: '',
+            form: {},
+            filter: [{
+                descVal: '2',
+                includeSub: true,
+                old: 'position',
+                partyId: '',
+                partyName: '',
+                scriptContent: '',
+                type: 'user',
+                userType: 'position'
+            }],
+            period: [
+                { label: '日监测', value: '每日' },
+                { label: '周监测', value: '每周' },
+                { label: '月监测', value: '每月' },
+                { label: '季度监测', value: '每季度' },
+                { label: '半年监测', value: '每半年' },
+                { label: '年监测', value: '每年' },
+                { label: '按时间间隔监测', value: '间隔' }
+            ],
+            config: {
+                '01-室内温湿度监控': {
+                    keyword: '',
+                    path: '/sshjgl/wdjc/snwsdjkcd'
+                },
+                '02-冰箱温度监控': {
+                    keyword: '冰箱,冰柜,冷藏,冷冻,低温,恒温,生化培养箱',
+                    path: '/sshjgl/wdjc/bxwdjc',
+                    showDevice: true
+                },
+                '03-温浴箱温度监控': {
+                    keyword: '',
+                    path: '/sshjgl/wdjc/wyxwdjkywh',
+                    showDevice: true
+                },
+                '04-阴凉柜温度监控': {
+                    keyword: '',
+                    path: '/sshjgl/wdjc/ylgwdjc',
+                    showDevice: true
+                },
+                '05-纯水机水质监测': {
+                    keyword: '',
+                    path: '/sshjgl/csjszjcb',
+                    showDevice: true
+                },
+                '06-每日安全检查': {
+                    keyword: '',
+                    path: '/sshjgl/aqgl/mraqjc'
+                },
+                // '07-每月安全检查': {
+                //     keyword: '',
+                //     path: '/sshjgl/aqgl/myaqjc'
+                // },
+                '08-含氯有效性监测': {
+                    keyword: '',
+                    path: '/sshjgl/aqgl/hlyxxjc'
+                },
+                // '09-紫外灯辐照测定': {
+                //     keyword: '',
+                //     path: '/sshjgl/aqgl/zwdfzd',
+                //     showDevice: true
+                // },
+                '10-洗眼器检查': {
+                    keyword: '',
+                    path: '/sshjgl/aqgl/xyqjc',
+                    showDevice: true
+                },
+                '11-紧急淋浴器检查': {
+                    keyword: '',
+                    path: '/sshjgl/aqgl/jjlyqjc',
+                    showDevice: true
+                },
+                '12-紫外灯消毒': {
+                    keyword: '',
+                    path: '/sshjgl/aqgl/jykzwdxdjlb',
+                    showDevice: true
+                },
+                '13-高压灭菌': {
+                    keyword: '',
+                    path: '/sshjgl/aqgl/gymjjlb',
+                    showDevice: true
+                },
+                '14-空气消毒机': {
+                    keyword: '',
+                    path: '/sshjgl/aqgl/xdjsyjlb',
+                    showDevice: true
+                },
+                '15-日常防护消毒': {
+                    keyword: '',
+                    path: '/sshjgl/aqgl/rcfhxd'
+                }
+            }
+        }
+    },
+    computed: {
+        labelShow () {
+            if (this.form.zhou_qi_) {
+                if (this.form.zhou_qi_ !== '间隔') {
+                    return this.form.zhou_qi_.split('每')[1] + '监测日期:'
+                }
+                return '间隔时间'
+            }
+            return ''
+        }
+    },
+    watch: {
+        params: {
+            handler (val) {
+                this.form = val
+            },
+            immediate: true
+        },
+        day: {
+            handler (val) {
+                this.dayCheck = val
+            }
+        },
+        week: {
+            handler (val) {
+                this.weekCheck = val
+            }
+        },
+        month: {
+            handler (val) {
+                this.monthCheck = val
+            }
+        },
+        quarter: {
+            handler (val) {
+                this.quarterCheck = val
+            }
+        },
+        halfYear: {
+            handler (val) {
+                this.halfYearCheck = val
+            }
+        },
+        year: {
+            handler (val) {
+                this.yearCheck = val
+            }
+        },
+        sep: {
+            handler (val) {
+                this.sepCheck = val
+            }
+        },
+        'form.zhou_qi_' (val) {
+            this.dayCheck = []
+            this.weekCheck = ''
+            this.monthCheck = ''
+            this.quarterCheck = ''
+            this.halfYearCheck = ''
+            this.yearCheck = ''
+            this.sepCheck = ''
+            this.form.kai_shi_shi_jian_ = ''
+            this.nextDate = ''
+        },
+        dayCheck: {
+            handler: function (val, oldVal) {
+                this.formatRiQi()
+                if (val.length === 0) {
+                    this.nextDate = ''
+                    return
+                }
+                const temp_val = JSON.parse(JSON.stringify(val))
+                const today = new Date()
+                temp_val.sort(function (a, b) {
+                    return a - b
+                })
+                const num = temp_val.findIndex(e => e > today.getDay())
+                if (temp_val.length > 0 && num !== -1) {
+                    this.nextDate = this.getDayDate(temp_val[num], 0)
+                } else if (temp_val.length > 0 && num === -1) {
+                    this.nextDate = this.getDayDate(temp_val[0], 1)
+                } else {
+                    this.nextDate = ''
+                }
+            },
+            immediate: true
+        },
+        weekCheck: {
+            handler: function (val, oldVal) {
+                this.formatRiQi()
+                if (val === '') {
+                    this.nextDate = ''
+                    return
+                }
+                const today = new Date()
+                const weekNum = []
+                weekNum.push(val)
+                const num = weekNum.findIndex(e => e > today.getDay())
+                if (val !== '' && num !== -1) {
+                    this.nextDate = this.getDayDate(weekNum[0], 0)
+                } else if (val !== '' && num === -1) {
+                    this.nextDate = this.getDayDate(weekNum[0], 1)
+                } else {
+                    this.nextDate = ''
+                }
+            },
+            immediate: true
+        },
+        monthCheck: {
+            handler: function (val, oldVal) {
+                this.formatRiQi()
+                if (val === '') {
+                    this.nextDate = ''
+                    return
+                }
+                const today = new Date()
+                const day = today.getDate()
+                const nextMonth = this.getNextMonthDate(today, val, 1)
+                const currentMonth = this.getNextMonthDate(today, val, 0)
+                this.nextDate = val > day ? currentMonth : nextMonth
+            }
+            // immediate: true
+        },
+        quarterCheck: {
+            handler: function (val, oldVal) {
+                this.formatRiQi()
+                if (val === '') {
+                    this.nextDate = ''
+                    return
+                }
+                const quarterList = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]
+                const today = new Date()
+                const month = today.getMonth() + 1
+                const qu = this.getQuarter(today)
+                const nowM = quarterList[qu - 1][val - 1]
+                const nextM = quarterList[qu % 4][val - 1]
+
+                const endMonth = month >= nowM ? nextM : nowM
+                const yearPJ = today.getFullYear()
+                const monthPJ = endMonth > 9 ? endMonth : '0' + endMonth
+
+                this.nextDate = yearPJ + '-' + monthPJ + '-01'
+            }
+            // immediate: true
+        },
+        halfYearCheck: {
+            handler: function (val, oldVal) {
+                this.formatRiQi()
+                if (val === '') {
+                    this.nextDate = ''
+                    return
+                }
+                const midList = [[1, 2, 3, 4, 5, 6], [7, 8, 9, 10, 11, 12]]
+                const today = new Date()
+                const month = today.getMonth() + 1
+                const qu = month > 6 ? 2 : 1
+                const nowM = midList[qu - 1][val - 1]
+                const nextM = midList[qu % 2][val - 1]
+
+                const endMonth = month >= nowM ? nextM : nowM
+                const yearPJ = month >= nowM ? today.getFullYear() + 1 : today.getFullYear()
+                const monthPJ = endMonth > 9 ? endMonth : '0' + endMonth
+
+                this.nextDate = yearPJ + '-' + monthPJ + '-01'
+            }
+            // immediate: true
+        },
+        yearCheck: {
+            handler: function (val, oldVal) {
+                this.formatRiQi()
+                if (val === '') {
+                    this.nextDate = ''
+                    return
+                }
+                const today = new Date()
+                const month = today.getMonth() + 1
+                const year = today.getFullYear()
+                const qu = month >= val ? year + 1 : year
+                const monthPJ = val > 9 ? val : '0' + val
+
+                this.nextDate = qu + '-' + monthPJ + '-01'
+            }
+            // immediate: true
+        },
+        sepCheck: {
+            handler: function (val, oldVal) {
+                this.formatRiQi()
+            }
+        },
+        'form.kai_shi_shi_jian_': {
+            handler: function (val, oldVal) {
+                this.formatRiQi()
+            }
+        }
+    },
+    methods: {
+        getDayDate (type, dates) {
+            const now = new Date()
+            const nowTime = now.getTime()
+            const day = now.getDay()
+            const longTime = 24 * 60 * 60 * 1000
+            const n = longTime * 7 * (dates || 0)
+            let dd = nowTime - (day - type) * longTime + n
+            dd = new Date(dd)
+            const y = dd.getFullYear()
+            let m = dd.getMonth() + 1
+            let d = dd.getDate()
+            m = m < 10 ? '0' + m : m
+            d = d < 10 ? '0' + d : d
+            const daynow = y + '-' + m + '-' + d
+            return daynow
+        },
+        // 获取往后几个月相应的日期
+        // currentDate:当前日期
+        // dayOfMonth:获取几号
+        // val:往后几个月
+        getNextMonthDate (currentDate, dayOfMonth, val) {
+            const currentYear = currentDate.getFullYear()
+            const currentMonth = currentDate.getMonth()
+            const nextMonth = currentMonth + val
+
+            const nextMonthDate = new Date(currentYear, nextMonth, dayOfMonth)
+            const formattedDate = nextMonthDate.toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '-')
+            return formattedDate
+        },
+        // 获取当前季度
+        getQuarter (date) {
+            return Math.floor(date.getMonth() / 3) + 1
+        },
+        formatRiQi () {
+            switch (this.form.zhou_qi_) {
+                case '每日':
+                    if (!this.dayCheck || this.dayCheck.length === 0) {
+                        this.form.jian_ce_ri_qi_ = ''
+                        this.form.ri_qi_lie_biao_ = ''
+                    } else if (this.dayCheck.length === 7) {
+                        this.form.jian_ce_ri_qi_ = '每天'
+                        this.form.ri_qi_lie_biao_ = '1,2,3,4,5,6,7'
+                    } else {
+                        const temp_dayCheck = JSON.parse(JSON.stringify(this.dayCheck))
+                        temp_dayCheck.sort(function (a, b) {
+                            return a - b
+                        })
+                        this.form.ri_qi_lie_biao_ = temp_dayCheck.join(',')
+                        this.form.jian_ce_ri_qi_ = '每周' + temp_dayCheck.join(',')
+                    }
+                    break
+                case '每周':
+                    if (this.weekCheck) {
+                        this.form.jian_ce_ri_qi_ = '每周' + this.weekCheck
+                        this.form.ri_qi_lie_biao_ = this.weekCheck + ''
+                    } else {
+                        this.form.jian_ce_ri_qi_ = ''
+                        this.form.ri_qi_lie_biao_ = ''
+                    }
+
+                    break
+                case '每月':
+                    if (this.monthCheck) {
+                        this.form.jian_ce_ri_qi_ = '每个月第' + this.monthCheck + '天'
+                        this.form.ri_qi_lie_biao_ = this.monthCheck + ''
+                    } else {
+                        this.form.jian_ce_ri_qi_ = ''
+                        this.form.ri_qi_lie_biao_ = ''
+                    }
+
+                    break
+                case '每季度':
+                    if (this.quarterCheck) {
+                        this.form.jian_ce_ri_qi_ = '每季度第' + this.quarterCheck + '个月'
+                        this.form.ri_qi_lie_biao_ = this.quarterCheck + ''
+                    } else {
+                        this.form.jian_ce_ri_qi_ = ''
+                        this.form.ri_qi_lie_biao_ = ''
+                    }
+
+                    break
+                case '每半年':
+                    if (this.halfYearCheck) {
+                        this.form.jian_ce_ri_qi_ = '每半年第' + this.halfYearCheck + '个月'
+                        this.form.ri_qi_lie_biao_ = this.halfYearCheck + ''
+                    } else {
+                        this.form.jian_ce_ri_qi_ = ''
+                        this.form.ri_qi_lie_biao_ = ''
+                    }
+
+                    break
+                case '每年':
+                    if (this.yearCheck) {
+                        this.form.jian_ce_ri_qi_ = '每年第' + this.yearCheck + '个月'
+                        this.form.ri_qi_lie_biao_ = this.yearCheck + ''
+                    } else {
+                        this.form.jian_ce_ri_qi_ = ''
+                        this.form.ri_qi_lie_biao_ = ''
+                    }
+                    break
+                case '间隔':
+                    if (this.sepCheck && this.form.kai_shi_shi_jian_) {
+                        this.form.jian_ce_ri_qi_ = this.form.kai_shi_shi_jian_ + '起每隔' + this.sepCheck + '天'
+                        this.form.ri_qi_lie_biao_ = this.sepCheck + ''
+                    } else {
+                        this.form.jian_ce_ri_qi_ = ''
+                        this.form.ri_qi_lie_biao_ = ''
+                    }
+                    break
+                default:
+                    this.form.jian_ce_ri_qi_ = ''
+                    this.form.ri_qi_lie_biao_ = ''
+                    break
+            }
+        },
+        emitParent (type) {
+            this.$confirm('正在进行批量替换操作,请确保数据的正确性,是否继续?', '提示', {
+                confirmButtonText: '继续',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                this.$emit('emitParent', type)
+            }).catch(() => {
+            })
+        },
+        // 接收自定义组件数据
+        onFacilityData (...arg) {
+            if (arg.length > 1) {
+                this.form.lie_biao_shu_ju_ = arg[1]
+            }
+        },
+        handleClose () {
+            this.$emit('update:dialogVisible', false)
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.contain{
+    .form{
+        padding: 20px;
+        height: 60vh;
+        .el-row{
+            margin: 10px 0;
+        }
+    }
+    .el-row{
+            margin: 0 !important;
+    }
+}
+.dialog-footer{
+        display: flex;
+        justify-content: center;
+    }
+    ::v-deep {
+        .el-form-item__label{
+            text-align: left
+        }
+        .el-form-item__content{
+        display: flex;
+        }
+
+    }
+</style>

+ 72 - 387
src/views/system/fasc/facilityEnvConfig.vue

@@ -55,133 +55,11 @@
                                 </el-form-item>
                                 </el-form-item>
                             </el-col>
                             </el-col>
                         </el-row>
                         </el-row>
-                        <el-alert
-                            title="默认数据,配置详情中的同名字段为空则使用以下默认数据"
-                            type="success"
-                            :closable="false"
-                        />
-                        <el-row>
-                            <el-col :span="12">
-                                <el-form-item label="部门:">
-                                    <ibps-user-selector
-                                        v-model="form.bian_zhi_bu_men_"
-                                        size="mini"
-                                        type="position"
-                                        readonly-text="text"
-                                        :disabled="false"
-                                        :multiple="false"
-                                        style="width:80%"
-                                        :filter="filter"
-                                        filterable
-                                    />
-                                </el-form-item>
-                            </el-col>
-                            <el-col :span="12">
-                                <el-form-item label="监测岗位:">
-                                    <el-select v-model="form.gang_wei_" placeholder="请选择" size="mini" style="width:80%">
-                                        <el-option
-                                            v-for="item in jianCeGangWeiList"
-                                            :key="item.id_"
-                                            :label="item.wei_hu_gang_wei_"
-                                            :value="item.wei_hu_gang_wei_"
-                                        />
-                                    </el-select>
-                                </el-form-item>
-                            </el-col>
-                        </el-row>
-                        <el-row>
-                            <el-col :span="12">
-                                <el-form-item label="监测周期:">
-                                    <el-select v-model="form.zhou_qi_" placeholder="请选择" size="mini" style="width:80%">
-                                        <el-option
-                                            v-for="item in period"
-                                            :key="item.value"
-                                            :label="item.label"
-                                            :value="item.value"
-                                        />
-                                    </el-select>
-                                </el-form-item>
-                            </el-col>
-                        </el-row>
-                        <el-row v-if="form.zhou_qi_!==''">
-                            <el-col :span="12">
-                                <el-form-item :label="labelShow" label-width="150">
-                                    <el-checkbox-group v-if="form.zhou_qi_==='每日'" v-model="dayCheck">
-                                        <el-checkbox :label="1">周一</el-checkbox>
-                                        <el-checkbox :label="2">周二</el-checkbox>
-                                        <el-checkbox :label="3">周三</el-checkbox>
-                                        <el-checkbox :label="4">周四</el-checkbox>
-                                        <el-checkbox :label="5">周五</el-checkbox>
-                                        <el-checkbox :label="6">周六</el-checkbox>
-                                        <el-checkbox :label="7">周日</el-checkbox>
-                                    </el-checkbox-group>
-                                    <template v-if="form.zhou_qi_==='每周'">
-                                        <el-radio v-model="weekCheck" :label="1">周一</el-radio>
-                                        <el-radio v-model="weekCheck" :label="2">周二</el-radio>
-                                        <el-radio v-model="weekCheck" :label="3">周三</el-radio>
-                                        <el-radio v-model="weekCheck" :label="4">周四</el-radio>
-                                        <el-radio v-model="weekCheck" :label="5">周五</el-radio>
-                                        <el-radio v-model="weekCheck" :label="6">周六</el-radio>
-                                        <el-radio v-model="weekCheck" :label="7">周日</el-radio>
-                                    </template>
-                                    <el-select v-if="form.zhou_qi_==='每月'" v-model="monthCheck" placeholder="请选择" size="mini" style="width:80%">
-                                        <el-option
-                                            v-for="item in 28"
-                                            :key="item"
-                                            :label="`第${item}天`"
-                                            :value="item"
-                                        />
-                                    </el-select>
-                                    <el-select v-if="form.zhou_qi_==='每季度'" v-model="quarterCheck" placeholder="请选择" size="mini" style="width:80%">
-                                        <el-option
-                                            v-for="item in 3"
-                                            :key="item"
-                                            :label="`第${item}个月`"
-                                            :value="item"
-                                        />
-                                    </el-select>
-                                    <el-select v-if="form.zhou_qi_==='每半年'" v-model="halfYearCheck" placeholder="请选择" size="mini" style="width:80%">
-                                        <el-option
-                                            v-for="item in 6"
-                                            :key="item"
-                                            :label="`第${item}个月`"
-                                            :value="item"
-                                        />
-                                    </el-select>
-                                    <el-select v-if="form.zhou_qi_==='每年'" v-model="yearCheck" placeholder="请选择" size="mini" style="width:80%">
-                                        <el-option
-                                            v-for="item in 12"
-                                            :key="item"
-                                            :label="`第${item}个月`"
-                                            :value="item"
-                                        />
-                                    </el-select>
-                                </el-form-item>
-
-                            </el-col>
-                            <el-col v-if="nextDate" :span="12">
-                                <el-form-item label="下次监测日期为:" label-width="150">
-                                    <el-tag>{{ nextDate }}</el-tag>
-                                </el-form-item>
-                            </el-col>
-                        </el-row>
-                        <el-row>
-                            <el-col :span="12">
-                                <el-form-item label="控制条件:">
-                                    <el-input v-model="form.tiao_jian_" type="textarea" :rows="2" size="mini" style="width:80%" />
-                                </el-form-item>
-                            </el-col>
-                        </el-row>
-                        <el-row>
-                            <el-col :span="24">
-                                <FacilityData v-if="form.lie_biao_shu_ju_" :form-data="{lieBiaoShuJu:form.lie_biao_shu_ju_}" :is-cul="false" @change-data="onFacilityData" />
-                            </el-col>
-
-                        </el-row>
                     </el-form>
                     </el-form>
                 </div>
                 </div>
                 <!-- <el-divider /> -->
                 <!-- <el-divider /> -->
                 <div class="table">
                 <div class="table">
+                    <el-alert type="success" title="设施环境设备" :closable="false" />
                     <div class="hearder">
                     <div class="hearder">
                         <div class="search">
                         <div class="search">
                             <div class="search-item">
                             <div class="search-item">
@@ -249,9 +127,12 @@
                             <div class="search-item" style="width:70px">
                             <div class="search-item" style="width:70px">
                                 <el-button type="primary" size="mini" icon="el-icon-download" @click="exportExcel">导出</el-button>
                                 <el-button type="primary" size="mini" icon="el-icon-download" @click="exportExcel">导出</el-button>
                             </div> -->
                             </div> -->
-                            <div v-if="trueList.length>0" class="search-item" style="width:120px">
-                                <el-button type="info" size="mini" icon="el-icon-setting" @click="settingData">使用默认数据</el-button>
+                            <div class="search-item" style="width:100px">
+                                <el-button type="info" size="mini" icon="el-icon-setting" @click="settingData">批量配置</el-button>
                             </div>
                             </div>
+                            <!-- <div v-if="trueList.length>0" class="search-item" style="width:120px">
+                                <el-button type="info" size="mini" icon="el-icon-setting" @click="settingData">使用默认数据</el-button>
+                            </div> -->
                             <div class="search-item" style="width:70px">
                             <div class="search-item" style="width:70px">
                                 <el-button type="danger" size="mini" icon="ibps-icon-close" @click="removeItem">删除</el-button>
                                 <el-button type="danger" size="mini" icon="ibps-icon-close" @click="removeItem">删除</el-button>
                             </div>
                             </div>
@@ -357,6 +238,20 @@
                 </div>
                 </div>
             </div>
             </div>
             <FecDialog v-if="subDialogVisible" ref="FecDialogRef" @onSubmit="sonSubmit" @onClose="sonClose" />
             <FecDialog v-if="subDialogVisible" ref="FecDialogRef" @onSubmit="sonSubmit" @onClose="sonClose" />
+            <DefaultSettingDialog
+                ref="DefaultSettingDialogRef"
+                :dialog-visible.sync="defultdialogVisible"
+                :jian-ce-gang-wei-list="jianCeGangWeiList"
+                :params="form"
+                :day="dayCheck"
+                :week="weekCheck"
+                :month="monthCheck"
+                :quarter="quarterCheck"
+                :half-year="halfYearCheck"
+                :year="yearCheck"
+                :sep="sepCheck"
+                @emitParent="handleSetting"
+            />
         </div>
         </div>
     </el-dialog>
     </el-dialog>
 </template>
 </template>
@@ -367,8 +262,10 @@ import xlsx from 'xlsx'
 import fs from 'file-saver'
 import fs from 'file-saver'
 import FecDialog from './fecDialog.vue'
 import FecDialog from './fecDialog.vue'
 import FacilityData from '@/views/component/facility/facilityData.vue'
 import FacilityData from '@/views/component/facility/facilityData.vue'
+import DefaultSettingDialog from './defaultSettingDialog.vue'
 export default {
 export default {
     components: {
     components: {
+        DefaultSettingDialog,
         FacilityData,
         FacilityData,
         ibpsUserSelector,
         ibpsUserSelector,
         FecDialog,
         FecDialog,
@@ -387,6 +284,7 @@ export default {
     data () {
     data () {
         const { userId, level = {}, position } = this.$store.getters || {}
         const { userId, level = {}, position } = this.$store.getters || {}
         return {
         return {
+            defultdialogVisible: false,
             filter: [{
             filter: [{
                 descVal: '2',
                 descVal: '2',
                 includeSub: true,
                 includeSub: true,
@@ -428,6 +326,7 @@ export default {
             quarterCheck: '',
             quarterCheck: '',
             halfYearCheck: '',
             halfYearCheck: '',
             yearCheck: '',
             yearCheck: '',
+            sepCheck: '',
             form: {
             form: {
                 di_dian_: level.second || level.first,
                 di_dian_: level.second || level.first,
                 bian_zhi_ren_: userId,
                 bian_zhi_ren_: userId,
@@ -440,7 +339,8 @@ export default {
                 jian_ce_ri_qi_: '',
                 jian_ce_ri_qi_: '',
                 ri_qi_lie_biao_: '',
                 ri_qi_lie_biao_: '',
                 mo_kuai_lu_jing_: '',
                 mo_kuai_lu_jing_: '',
-                lie_biao_shu_ju_: ''
+                lie_biao_shu_ju_: '',
+                kai_shi_shi_jian_: ''
             },
             },
             subForm: [
             subForm: [
 
 
@@ -623,13 +523,13 @@ export default {
                             { label: '温度', range: [], fixValue: '', value: '', result: '', status: '', unit: '℃' }
                             { label: '温度', range: [], fixValue: '', value: '', result: '', status: '', unit: '℃' }
                         ])
                         ])
                         break
                         break
-                    // case '05-纯水机水质监测':
-                    //     this.form.lie_biao_shu_ju_ = JSON.stringify([
-                    //         { label: '电阻率', range: [10, null], fixValue: '', value: '', result: '', status: '', unit: 'MΩ·CM' },
-                    //         { label: '电导率', range: [0, 1], fixValue: '', value: '', result: '', status: '', unit: 'uS/cm' },
-                    //         { label: '微生物含量', range: [0, 10], fixValue: '', value: '', result: '', status: '', unit: 'cfu/ml' }
-                    //     ])
-                    //     break
+                    case '05-纯水机水质监测':
+                        this.form.lie_biao_shu_ju_ = JSON.stringify([
+                            { label: '电阻率', range: [10, null], fixValue: '', value: '', result: '', status: '', unit: 'MΩ·CM' },
+                            { label: '电导率', range: [0, 1], fixValue: '', value: '', result: '', status: '', unit: 'uS/cm' },
+                            { label: '微生物含量', range: [0, 10], fixValue: '', value: '', result: '', status: '', unit: 'cfu/ml' }
+                        ])
+                        break
                     default:
                     default:
                         delete this.form.lie_biao_shu_ju_
                         delete this.form.lie_biao_shu_ju_
                         break
                         break
@@ -643,127 +543,8 @@ export default {
             this.quarterCheck = ''
             this.quarterCheck = ''
             this.halfYearCheck = ''
             this.halfYearCheck = ''
             this.yearCheck = ''
             this.yearCheck = ''
+            this.sepCheck = ''
             this.nextDate = ''
             this.nextDate = ''
-        },
-        dayCheck: {
-            handler: function (val, oldVal) {
-                this.formatRiQi()
-                if (val.length === 0) {
-                    this.nextDate = ''
-                    return
-                }
-                const temp_val = JSON.parse(JSON.stringify(val))
-                const today = new Date()
-                temp_val.sort(function (a, b) {
-                    return a - b
-                })
-                const num = temp_val.findIndex(e => e > today.getDay())
-                if (temp_val.length > 0 && num !== -1) {
-                    this.nextDate = this.getDayDate(temp_val[num], 0)
-                } else if (temp_val.length > 0 && num === -1) {
-                    this.nextDate = this.getDayDate(temp_val[0], 1)
-                } else {
-                    this.nextDate = ''
-                }
-            },
-            immediate: true
-        },
-        weekCheck: {
-            handler: function (val, oldVal) {
-                this.formatRiQi()
-                if (val === '') {
-                    this.nextDate = ''
-                    return
-                }
-                const today = new Date()
-                const weekNum = []
-                weekNum.push(val)
-                const num = weekNum.findIndex(e => e > today.getDay())
-                if (val !== '' && num !== -1) {
-                    this.nextDate = this.getDayDate(weekNum[0], 0)
-                } else if (val !== '' && num === -1) {
-                    this.nextDate = this.getDayDate(weekNum[0], 1)
-                } else {
-                    this.nextDate = ''
-                }
-            },
-            immediate: true
-        },
-        monthCheck: {
-            handler: function (val, oldVal) {
-                this.formatRiQi()
-                if (val === '') {
-                    this.nextDate = ''
-                    return
-                }
-                const today = new Date()
-                const day = today.getDate()
-                const nextMonth = this.getNextMonthDate(today, val, 1)
-                const currentMonth = this.getNextMonthDate(today, val, 0)
-                this.nextDate = val > day ? currentMonth : nextMonth
-            }
-            // immediate: true
-        },
-        quarterCheck: {
-            handler: function (val, oldVal) {
-                this.formatRiQi()
-                if (val === '') {
-                    this.nextDate = ''
-                    return
-                }
-                const quarterList = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]
-                const today = new Date()
-                const month = today.getMonth() + 1
-                const qu = this.getQuarter(today)
-                const nowM = quarterList[qu - 1][val - 1]
-                const nextM = quarterList[qu % 4][val - 1]
-
-                const endMonth = month >= nowM ? nextM : nowM
-                const yearPJ = today.getFullYear()
-                const monthPJ = endMonth > 9 ? endMonth : '0' + endMonth
-
-                this.nextDate = yearPJ + '-' + monthPJ + '-01'
-            }
-            // immediate: true
-        },
-        halfYearCheck: {
-            handler: function (val, oldVal) {
-                this.formatRiQi()
-                if (val === '') {
-                    this.nextDate = ''
-                    return
-                }
-                const midList = [[1, 2, 3, 4, 5, 6], [7, 8, 9, 10, 11, 12]]
-                const today = new Date()
-                const month = today.getMonth() + 1
-                const qu = month > 6 ? 2 : 1
-                const nowM = midList[qu - 1][val - 1]
-                const nextM = midList[qu % 2][val - 1]
-
-                const endMonth = month >= nowM ? nextM : nowM
-                const yearPJ = month >= nowM ? today.getFullYear() + 1 : today.getFullYear()
-                const monthPJ = endMonth > 9 ? endMonth : '0' + endMonth
-
-                this.nextDate = yearPJ + '-' + monthPJ + '-01'
-            }
-            // immediate: true
-        },
-        yearCheck: {
-            handler: function (val, oldVal) {
-                this.formatRiQi()
-                if (val === '') {
-                    this.nextDate = ''
-                    return
-                }
-                const today = new Date()
-                const month = today.getMonth() + 1
-                const year = today.getFullYear()
-                const qu = month >= val ? year + 1 : year
-                const monthPJ = val > 9 ? val : '0' + val
-
-                this.nextDate = qu + '-' + monthPJ + '-01'
-            }
-            // immediate: true
         }
         }
     },
     },
     mounted () {
     mounted () {
@@ -777,12 +558,6 @@ export default {
         }
         }
     },
     },
     methods: {
     methods: {
-        // 接收自定义组件数据
-        onFacilityData (...arg) {
-            if (arg.length > 1) {
-                this.form.lie_biao_shu_ju_ = arg[1]
-            }
-        },
         init () {
         init () {
             this.loadSelectorData()
             this.loadSelectorData()
         },
         },
@@ -804,6 +579,7 @@ export default {
                 }
                 }
                 this.form = data[0]
                 this.form = data[0]
                 const jian_ce_ri_qi_ = data[0].jian_ce_ri_qi_
                 const jian_ce_ri_qi_ = data[0].jian_ce_ri_qi_
+                const ri_qi_lie_biao_ = data[0].ri_qi_lie_biao_
                 if (this.form.jian_ce_ri_qi_) {
                 if (this.form.jian_ce_ri_qi_) {
                     this.$nextTick(() => {
                     this.$nextTick(() => {
                         switch (this.form.zhou_qi_) {
                         switch (this.form.zhou_qi_) {
@@ -829,6 +605,9 @@ export default {
                             case '每年':
                             case '每年':
                                 this.yearCheck = +jian_ce_ri_qi_.split('每年第')[1].split('个月')[0]
                                 this.yearCheck = +jian_ce_ri_qi_.split('每年第')[1].split('个月')[0]
                                 break
                                 break
+                            case '间隔':
+                                this.sepCheck = ri_qi_lie_biao_
+                                break
                             default:
                             default:
                                 break
                                 break
                         }
                         }
@@ -852,99 +631,18 @@ export default {
                 this.subIdList = data.map(item => item.zi_wai_deng_wai_j)
                 this.subIdList = data.map(item => item.zi_wai_deng_wai_j)
             })
             })
         },
         },
-        formatRiQi () {
-            switch (this.form.zhou_qi_) {
-                case '每日':
-                    if (!this.dayCheck || this.dayCheck.length === 0) {
-                        this.form.jian_ce_ri_qi_ = ''
-                        this.form.ri_qi_lie_biao_ = ''
-                    } else if (this.dayCheck.length === 7) {
-                        this.form.jian_ce_ri_qi_ = '每天'
-                        this.form.ri_qi_lie_biao_ = '1,2,3,4,5,6,7'
-                    } else {
-                        const temp_dayCheck = JSON.parse(JSON.stringify(this.dayCheck))
-                        temp_dayCheck.sort(function (a, b) {
-                            return a - b
-                        })
-                        this.form.ri_qi_lie_biao_ = temp_dayCheck.join(',')
-                        this.form.jian_ce_ri_qi_ = '每周' + temp_dayCheck.join(',')
-                    }
-                    break
-                case '每周':
-                    if (this.weekCheck) {
-                        this.form.jian_ce_ri_qi_ = '每周' + this.weekCheck
-                        this.form.ri_qi_lie_biao_ = this.weekCheck + ''
-                    } else {
-                        this.form.jian_ce_ri_qi_ = ''
-                        this.form.ri_qi_lie_biao_ = ''
-                    }
-
-                    break
-                case '每月':
-                    if (this.monthCheck) {
-                        this.form.jian_ce_ri_qi_ = '每个月第' + this.monthCheck + '天'
-                        this.form.ri_qi_lie_biao_ = this.monthCheck + ''
-                    } else {
-                        this.form.jian_ce_ri_qi_ = ''
-                        this.form.ri_qi_lie_biao_ = ''
-                    }
-
-                    break
-                case '每季度':
-                    if (this.quarterCheck) {
-                        this.form.jian_ce_ri_qi_ = '每季度第' + this.quarterCheck + '个月'
-                        this.form.ri_qi_lie_biao_ = this.quarterCheck + ''
-                    } else {
-                        this.form.jian_ce_ri_qi_ = ''
-                        this.form.ri_qi_lie_biao_ = ''
-                    }
-
-                    break
-                case '每半年':
-                    if (this.halfYearCheck) {
-                        this.form.jian_ce_ri_qi_ = '每半年第' + this.halfYearCheck + '个月'
-                        this.form.ri_qi_lie_biao_ = this.halfYearCheck + ''
-                    } else {
-                        this.form.jian_ce_ri_qi_ = ''
-                        this.form.ri_qi_lie_biao_ = ''
-                    }
-
-                    break
-                case '每年':
-                    if (this.yearCheck) {
-                        this.form.jian_ce_ri_qi_ = '每年第' + this.yearCheck + '个月'
-                        this.form.ri_qi_lie_biao_ = this.yearCheck + ''
-                    } else {
-                        this.form.jian_ce_ri_qi_ = ''
-                        this.form.ri_qi_lie_biao_ = ''
-                    }
-
-                    break
-                default:
-                    this.form.jian_ce_ri_qi_ = ''
-                    this.form.ri_qi_lie_biao_ = ''
-                    break
-            }
+        handleSetting (type) {
+            this.form = this.$refs.DefaultSettingDialogRef.form
+            if (type === 'settingEmpty') this.settingEmpty()
+            else if (type === 'settingAll') this.settingAll()
+            this.defultdialogVisible = false
         },
         },
         // 使用默认数据
         // 使用默认数据
         settingData () {
         settingData () {
-            this.$confirm('选择默认数据的填充方式?', '提示', {
-                confirmButtonText: '完全替换',
-                cancelButtonText: '为空替换',
-                closeOnClickModal: false,
-                closeOnPressEscape: false,
-                distinguishCancelAndClose: true,
-                type: 'info'
-            })
-                .then(() => {
-                    this.settingAll()
-                })
-                .catch((action) => {
-                    if (action === 'close') return
-                    if (action === 'cancel') {
-                        this.settingEmpty()
-                    }
-                })
+            if (this.form.lei_xing_ === '') {
+                return this.$message.warning('请先选择类型!')
+            }
+            this.defultdialogVisible = true
         },
         },
         settingAll () {
         settingAll () {
             this.subForm.forEach(item => {
             this.subForm.forEach(item => {
@@ -955,7 +653,10 @@ export default {
                 item.ri_qi_lie_biao_ = this.form.ri_qi_lie_biao_
                 item.ri_qi_lie_biao_ = this.form.ri_qi_lie_biao_
                 item.jian_ce_zhou_qi_ = this.form.zhou_qi_
                 item.jian_ce_zhou_qi_ = this.form.zhou_qi_
                 item.lie_biao_shu_ju_ = this.form.lie_biao_shu_ju_
                 item.lie_biao_shu_ju_ = this.form.lie_biao_shu_ju_
+                item.kai_shi_shi_jian_ = this.form.kai_shi_shi_jian_
             })
             })
+            this.$message.success('完全批量替换成功!')
+            this.defultdialogVisible = false
         },
         },
         // 使用默认数据
         // 使用默认数据
         settingEmpty () {
         settingEmpty () {
@@ -978,6 +679,9 @@ export default {
                 if (item.jian_ce_zhou_qi_ === '') {
                 if (item.jian_ce_zhou_qi_ === '') {
                     item.jian_ce_zhou_qi_ = this.form.zhou_qi_
                     item.jian_ce_zhou_qi_ = this.form.zhou_qi_
                 }
                 }
+                if (item.kai_shi_shi_jian_ === '') {
+                    item.kai_shi_shi_jian_ = this.form.kai_shi_shi_jian_
+                }
                 if (this.form.lie_biao_shu_ju_) {
                 if (this.form.lie_biao_shu_ju_) {
                     if (item.lie_biao_shu_ju_) {
                     if (item.lie_biao_shu_ju_) {
                         const main = JSON.parse(this.form.lie_biao_shu_ju_)
                         const main = JSON.parse(this.form.lie_biao_shu_ju_)
@@ -1006,6 +710,8 @@ export default {
                     }
                     }
                 }
                 }
             })
             })
+            this.$message.success('空值批量替换成功!')
+            this.defultdialogVisible = false
         },
         },
         // 当前页码改变
         // 当前页码改变
         handleCurrentChange (val) {
         handleCurrentChange (val) {
@@ -1146,7 +852,8 @@ export default {
                                 jian_ce_ri_qi_: this.form.jian_ce_ri_qi_,
                                 jian_ce_ri_qi_: this.form.jian_ce_ri_qi_,
                                 ri_qi_lie_biao_: this.form.ri_qi_lie_biao_,
                                 ri_qi_lie_biao_: this.form.ri_qi_lie_biao_,
                                 mo_kuai_lu_jing_: this.form.mo_kuai_lu_jing_,
                                 mo_kuai_lu_jing_: this.form.mo_kuai_lu_jing_,
-                                lie_biao_shu_ju_: this.form.lie_biao_shu_ju_
+                                lie_biao_shu_ju_: this.form.lie_biao_shu_ju_,
+                                kai_shi_shi_jian_: this.form.kai_shi_shi_jian_
                             }
                             }
 
 
                         }
                         }
@@ -1173,7 +880,8 @@ export default {
                                     qu_yu_: item.qu_yu_,
                                     qu_yu_: item.qu_yu_,
                                     ri_qi_lie_biao_: item.ri_qi_lie_biao_,
                                     ri_qi_lie_biao_: item.ri_qi_lie_biao_,
                                     shi_fou_qi_yong_: item.shi_fou_qi_yong_,
                                     shi_fou_qi_yong_: item.shi_fou_qi_yong_,
-                                    zi_wai_deng_wai_j: item.zi_wai_deng_wai_j
+                                    zi_wai_deng_wai_j: item.zi_wai_deng_wai_j,
+                                    kai_shi_shi_jian_: item.kai_shi_shi_jian_
                                 }
                                 }
                             })
                             })
                         }
                         }
@@ -1199,7 +907,8 @@ export default {
                                     kong_zhi_tiao_jia: item.kong_zhi_tiao_jia,
                                     kong_zhi_tiao_jia: item.kong_zhi_tiao_jia,
                                     jian_ce_ri_qi_: item.jian_ce_ri_qi_,
                                     jian_ce_ri_qi_: item.jian_ce_ri_qi_,
                                     ri_qi_lie_biao_: item.ri_qi_lie_biao_,
                                     ri_qi_lie_biao_: item.ri_qi_lie_biao_,
-                                    lie_biao_shu_ju_: item.lie_biao_shu_ju_
+                                    lie_biao_shu_ju_: item.lie_biao_shu_ju_,
+                                    kai_shi_shi_jian_: item.kai_shi_shi_jian_
                                 }
                                 }
                             }))
                             }))
                         }
                         }
@@ -1246,7 +955,8 @@ export default {
                                     qu_yu_: item.qu_yu_,
                                     qu_yu_: item.qu_yu_,
                                     ri_qi_lie_biao_: item.ri_qi_lie_biao_,
                                     ri_qi_lie_biao_: item.ri_qi_lie_biao_,
                                     shi_fou_qi_yong_: item.shi_fou_qi_yong_,
                                     shi_fou_qi_yong_: item.shi_fou_qi_yong_,
-                                    zi_wai_deng_wai_j: item.zi_wai_deng_wai_j
+                                    zi_wai_deng_wai_j: item.zi_wai_deng_wai_j,
+                                    kai_shi_shi_jian_: item.kai_shi_shi_jian_
                                 }
                                 }
                             })
                             })
                         }
                         }
@@ -1439,39 +1149,6 @@ export default {
                 return buf
                 return buf
             }
             }
         },
         },
-        getDayDate (type, dates) {
-            const now = new Date()
-            const nowTime = now.getTime()
-            const day = now.getDay()
-            const longTime = 24 * 60 * 60 * 1000
-            const n = longTime * 7 * (dates || 0)
-            let dd = nowTime - (day - type) * longTime + n
-            dd = new Date(dd)
-            const y = dd.getFullYear()
-            let m = dd.getMonth() + 1
-            let d = dd.getDate()
-            m = m < 10 ? '0' + m : m
-            d = d < 10 ? '0' + d : d
-            const daynow = y + '-' + m + '-' + d
-            return daynow
-        },
-        // 获取往后几个月相应的日期
-        // currentDate:当前日期
-        // dayOfMonth:获取几号
-        // val:往后几个月
-        getNextMonthDate (currentDate, dayOfMonth, val) {
-            const currentYear = currentDate.getFullYear()
-            const currentMonth = currentDate.getMonth()
-            const nextMonth = currentMonth + val
-
-            const nextMonthDate = new Date(currentYear, nextMonth, dayOfMonth)
-            const formattedDate = nextMonthDate.toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '-')
-            return formattedDate
-        },
-        // 获取当前季度
-        getQuarter (date) {
-            return Math.floor(date.getMonth() / 3) + 1
-        },
         // 查询
         // 查询
         goSearch () {
         goSearch () {
             console.log(this.search)
             console.log(this.search)
@@ -1494,6 +1171,11 @@ export default {
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
+.sub-dialog{
+    .contain{
+        padding: 20px;
+    }
+}
 .paper-detail-dialog {
 .paper-detail-dialog {
     ::v-deep {
     ::v-deep {
         .el-dialog__header {
         .el-dialog__header {
@@ -1543,7 +1225,10 @@ export default {
             }
             }
         }
         }
         .table{
         .table{
-            margin-top: 40px;
+            margin-top: 20px;
+           .el-alert{
+             margin-bottom: 20px;
+           }
             .search{
             .search{
                 display: flex;
                 display: flex;
                 flex-wrap: wrap;
                 flex-wrap: wrap;

+ 58 - 19
src/views/system/fasc/fecDialog.vue

@@ -128,22 +128,12 @@
                         <el-col :span="12">
                         <el-col :span="12">
                             <el-form-item :label="labelShow">
                             <el-form-item :label="labelShow">
                                 <el-checkbox-group v-if="form.jian_ce_zhou_qi_==='每日'" v-model="dayCheck" size="mini">
                                 <el-checkbox-group v-if="form.jian_ce_zhou_qi_==='每日'" v-model="dayCheck" size="mini">
-                                    <el-checkbox :label="1" size="mini">周一</el-checkbox>
-                                    <el-checkbox :label="2" size="mini">周二</el-checkbox>
-                                    <el-checkbox :label="3" size="mini">周三</el-checkbox>
-                                    <el-checkbox :label="4" size="mini">周四</el-checkbox>
-                                    <el-checkbox :label="5" size="mini">周五</el-checkbox>
-                                    <el-checkbox :label="6" size="mini">周六</el-checkbox>
-                                    <el-checkbox :label="7" size="mini">周日</el-checkbox>
+                                    <el-checkbox v-for="item in weekDays" :key="item.value" :label="item.value" size="mini">{{ item.label }}</el-checkbox>
                                 </el-checkbox-group>
                                 </el-checkbox-group>
                                 <template v-if="form.jian_ce_zhou_qi_==='每周'">
                                 <template v-if="form.jian_ce_zhou_qi_==='每周'">
-                                    <el-radio v-model="weekCheck" :label="1" size="mini">周一</el-radio>
-                                    <el-radio v-model="weekCheck" :label="2" size="mini">周二</el-radio>
-                                    <el-radio v-model="weekCheck" :label="3" size="mini">周三</el-radio>
-                                    <el-radio v-model="weekCheck" :label="4" size="mini">周四</el-radio>
-                                    <el-radio v-model="weekCheck" :label="5" size="mini">周五</el-radio>
-                                    <el-radio v-model="weekCheck" :label="6" size="mini">周六</el-radio>
-                                    <el-radio v-model="weekCheck" :label="7" size="mini">周日</el-radio>
+                                    <div class="radio" style="width:100%">
+                                        <el-radio v-for="item in weekDays" :key="item.value" v-model="weekCheck" :label="item.value" size="mini">{{ item.label }}</el-radio>
+                                    </div>
                                 </template>
                                 </template>
                                 <el-select v-if="form.jian_ce_zhou_qi_==='每月'" v-model="monthCheck" placeholder="请选择" size="mini" style="width:80%">
                                 <el-select v-if="form.jian_ce_zhou_qi_==='每月'" v-model="monthCheck" placeholder="请选择" size="mini" style="width:80%">
                                     <el-option
                                     <el-option
@@ -177,6 +167,14 @@
                                         :value="item"
                                         :value="item"
                                     />
                                     />
                                 </el-select>
                                 </el-select>
+                                <el-select v-if="form.jian_ce_zhou_qi_==='间隔'" v-model="sepCheck" placeholder="请选择" size="mini" style="width:80%">
+                                    <el-option
+                                        v-for="item in 30"
+                                        :key="item"
+                                        :label="`每隔${item}天`"
+                                        :value="item"
+                                    />
+                                </el-select>
                             </el-form-item>
                             </el-form-item>
 
 
                         </el-col>
                         </el-col>
@@ -185,6 +183,20 @@
                                 <el-tag size="mini">{{ nextDate }}</el-tag>
                                 <el-tag size="mini">{{ nextDate }}</el-tag>
                             </el-form-item>
                             </el-form-item>
                         </el-col>
                         </el-col>
+                        <el-col v-if="form.jian_ce_zhou_qi_==='间隔'" :span="12">
+                            <el-form-item label="开始监测时间:" prop="">
+                                <el-date-picker
+                                    v-model="form.kai_shi_shi_jian_"
+                                    :clearable="false"
+                                    type="date"
+                                    placeholder="选择查询的月份"
+                                    :picker-options="pickerOptions"
+                                    value-format="yyyy-MM-dd"
+                                    size="mini"
+                                    style="width:80%"
+                                />
+                            </el-form-item>
+                        </el-col>
                     </el-row>
                     </el-row>
                     <el-row>
                     <el-row>
                         <el-col :span="22">
                         <el-col :span="22">
@@ -202,8 +214,8 @@
             </div>
             </div>
         </div>
         </div>
         <span slot="footer" class="dialog-footer">
         <span slot="footer" class="dialog-footer">
-            <el-button type="primary" @click="submit">确 定</el-button>
-            <el-button @click="close">取 消</el-button>
+            <el-button type="primary" icon="ibps-icon-save" size="mini" @click="submit">确 定</el-button>
+            <el-button icon="ibps-icon-close" type="danger" size="mini" @click="close">取 消</el-button>
         </span>
         </span>
     </el-dialog>
     </el-dialog>
 </template>
 </template>
@@ -221,6 +233,12 @@ export default {
     },
     },
     data () {
     data () {
         return {
         return {
+            pickerOptions: {
+                disabledDate (time) {
+                    return time.getTime() < (Date.now() - (24 * 60 * 1000 * 60))
+                }
+            },
+            weekDays: [{ label: '周一', value: 1 }, { label: '周二', value: 2 }, { label: '周三', value: 3 }, { label: '周四', value: 4 }, { label: '周五', value: 5 }, { label: '周六', value: 6 }, { label: '周日', value: 7 }],
             filter: [{
             filter: [{
                 descVal: '2',
                 descVal: '2',
                 includeSub: true,
                 includeSub: true,
@@ -249,7 +267,8 @@ export default {
                 jian_ce_ri_qi_: '',
                 jian_ce_ri_qi_: '',
                 ri_qi_lie_biao_: '',
                 ri_qi_lie_biao_: '',
                 zi_wai_deng_wai_j: '', // 紫外灯外键
                 zi_wai_deng_wai_j: '', // 紫外灯外键
-                lie_biao_shu_ju_: ''
+                lie_biao_shu_ju_: '',
+                kai_shi_shi_jian_: ''
             },
             },
             isEdit: false,
             isEdit: false,
             quYuList: [],
             quYuList: [],
@@ -261,13 +280,15 @@ export default {
             quarterCheck: '',
             quarterCheck: '',
             halfYearCheck: '',
             halfYearCheck: '',
             yearCheck: '',
             yearCheck: '',
+            sepCheck: '',
             period: [
             period: [
                 { label: '日监测', value: '每日' },
                 { label: '日监测', value: '每日' },
                 { label: '周监测', value: '每周' },
                 { label: '周监测', value: '每周' },
                 { label: '月监测', value: '每月' },
                 { label: '月监测', value: '每月' },
                 { label: '季度监测', value: '每季度' },
                 { label: '季度监测', value: '每季度' },
                 { label: '半年监测', value: '每半年' },
                 { label: '半年监测', value: '每半年' },
-                { label: '年监测', value: '每年' }
+                { label: '年监测', value: '每年' },
+                { label: '按时间间隔监测', value: '间隔' }
             ]
             ]
         }
         }
     },
     },
@@ -277,7 +298,10 @@ export default {
         },
         },
         labelShow () {
         labelShow () {
             if (this.form.jian_ce_zhou_qi_) {
             if (this.form.jian_ce_zhou_qi_) {
-                return this.form.jian_ce_zhou_qi_.split('每')[1] + '监测日期:'
+                if (this.form.jian_ce_zhou_qi_ !== '间隔') {
+                    return this.form.jian_ce_zhou_qi_.split('每')[1] + '监测日期:'
+                }
+                return '间隔时间'
             }
             }
             return ''
             return ''
         }
         }
@@ -290,7 +314,9 @@ export default {
             this.quarterCheck = ''
             this.quarterCheck = ''
             this.halfYearCheck = ''
             this.halfYearCheck = ''
             this.yearCheck = ''
             this.yearCheck = ''
+            this.sepCheck = ''
             this.nextDate = ''
             this.nextDate = ''
+            this.form.kai_shi_shi_jian_ = ''
         },
         },
         dayCheck: {
         dayCheck: {
             handler: function (val, oldVal) {
             handler: function (val, oldVal) {
@@ -495,6 +521,15 @@ export default {
                         this.form.ri_qi_lie_biao_ = ''
                         this.form.ri_qi_lie_biao_ = ''
                     }
                     }
                     break
                     break
+                case '间隔':
+                    if (this.sepCheck && this.form.kai_shi_shi_jian_) {
+                        this.form.jian_ce_ri_qi_ = this.form.kai_shi_shi_jian_ + '起每隔' + this.sepCheck + '天'
+                        this.form.ri_qi_lie_biao_ = this.sepCheck + ''
+                    } else {
+                        this.form.jian_ce_ri_qi_ = ''
+                        this.form.ri_qi_lie_biao_ = ''
+                    }
+                    break
                 default:
                 default:
                     break
                     break
             }
             }
@@ -558,6 +593,9 @@ export default {
                         case '每年':
                         case '每年':
                             this.yearCheck = +this.form.jian_ce_ri_qi_.split('每年第')[1].split('个月')[0]
                             this.yearCheck = +this.form.jian_ce_ri_qi_.split('每年第')[1].split('个月')[0]
                             break
                             break
+                        case '间隔':
+                            this.sepCheck = +this.form.ri_qi_lie_biao_
+                            break
                         default:
                         default:
                             break
                             break
                     }
                     }
@@ -581,6 +619,7 @@ export default {
                 this.form.jian_ce_zhou_qi_ = parentForm.zhou_qi_
                 this.form.jian_ce_zhou_qi_ = parentForm.zhou_qi_
                 this.form.ri_qi_lie_biao_ = parentForm.ri_qi_lie_biao_
                 this.form.ri_qi_lie_biao_ = parentForm.ri_qi_lie_biao_
                 this.form.lie_biao_shu_ju_ = parentForm.lie_biao_shu_ju_
                 this.form.lie_biao_shu_ju_ = parentForm.lie_biao_shu_ju_
+                this.form.kai_shi_shi_jian_ = parentForm.kai_shi_shi_jian_
             }
             }
             this.formatData()
             this.formatData()
         },
         },