Ver código fonte

设施环境页面

wy 1 ano atrás
pai
commit
5b695b9492

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

@@ -0,0 +1,620 @@
+<template>
+    <el-dialog
+        title="配置默认数据"
+        :visible.sync="dialogVisible"
+        width="65%"
+        style="margin-top:5vh"
+        top
+        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"
+                                    filtrate
+                                />
+                            </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 monitoringpPosition"
+                                        :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 size="mini" class="eltag">{{ 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-col :span="12">
+                            <el-form-item label="默认控制标准:">
+                                <el-input v-model="form.kong_zhi_biao_zhu" 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, Number],
+            default: ''
+        },
+        month: {
+            type: [String, Number],
+            default: ''
+        },
+        quarter: {
+            type: [String, Number],
+            default: ''
+        },
+        halfYear: {
+            type: [String, Number],
+            default: ''
+        },
+        year: {
+            type: [String, Number],
+            default: ''
+        },
+        sep: {
+            type: [String, Number],
+            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: '1',
+                includeSub: true,
+                old: 'position',
+                partyId: this.$store.getters.userInfo.employee.positions,
+                partyName: '',
+                scriptContent: '',
+                type: 'user',
+                userType: 'position'
+            }],
+            period: [
+                { label: '日监测', value: '每日' },
+                { label: '周监测', value: '每周' },
+                { label: '月监测', value: '每月' },
+                { label: '季度监测', value: '每季度' },
+                { label: '半年监测', value: '每半年' },
+                { label: '年监测', value: '每年' },
+                { label: '按时间间隔监测', value: '间隔' }
+            ]
+        }
+    },
+    computed: {
+        monitoringpPosition () {
+            return this.jianCeGangWeiList.filter(i => i.suo_shu_bu_men_ === this.form.bian_zhi_bu_men_)
+        },
+        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, old) {
+            if (!old) return
+            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) {
+            let msg = ''
+            if (type === 'settingEmpty') msg = '该操作会将未设置过的配置子表数据设置为默认值,是否继续?'
+            if (type === 'settingAll') msg = '该操作会将所有配置子表数据替换为默认值,是否继续?'
+            this.$confirm(msg, '提示', {
+                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;
+    }
+    .eltag{
+        margin-top: 6px;
+    }
+} 
+.dialog-footer{
+        display: flex;
+        justify-content: center;
+    }
+    ::v-deep {
+        .el-form-item__label{
+            text-align: left
+        }
+        .el-form-item__content{
+        display: flex;
+        }
+
+    }
+</style>

+ 1099 - 0
src/views/system/fasc/facilityEnvConfig.vue

@@ -0,0 +1,1099 @@
+<template>
+    <el-dialog
+        :title="title"
+        :visible.sync="dialogVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        :show-close="false"
+        append-to-body
+        fullscreen
+        class="dialog paper-detail-dialog"
+        top="0"
+    >
+        <div slot="title" class="dialog-title">
+            <span class="dialogtitle">{{ title }}</span>
+            <div>
+                <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
+            </div>
+        </div>
+        <div class="container">
+            <div class="main">
+                <div class="form">
+                    <el-form ref="form" :model="form" label-width="74px" :rules="rules" :hide-required-asterisk="true">
+                        <el-row>
+                            <el-col :span="12">
+                                <el-form-item label="类型:" prop="lei_xing_">
+                                    <template slot="label">
+                                        <span class="required">类型:</span>
+                                    </template>
+                                    <el-select v-model="form.lei_xing_" placeholder="请选择" size="mini" style="width:80%" :disabled="isEdit">
+                                        <el-option
+                                            v-for="(value,key) in config"
+                                            :key="key"
+                                            :label="value['label'] || key.split('-')[1]"
+                                            :value="key"
+                                        />
+                                    </el-select>
+                                </el-form-item>
+                            </el-col>
+                        </el-row>
+                    </el-form>
+                </div>
+                <!-- <el-divider /> -->
+                <div class="table">
+                    <el-alert type="success" title="配置详情" :closable="false" />
+                    <div class="hearder">
+                        <div class="search">
+                            <div class="search-item">
+                                <span class="label">部门:</span>
+                                <ibps-user-selector
+                                    v-model="search.buMen"
+                                    type="position"
+                                    readonly-text="text"
+                                    :disabled="false"
+                                    :multiple="false"
+                                    :filter="filter"
+                                    filtrate
+                                    size="mini"
+                                />
+                            </div>
+                            <div class="search-item">
+                                <span class="label">区域:</span>
+                                <el-input v-model="search.quYu" size="mini" placeholder="请输入" @keyup.enter.native="goSearch" />
+                            </div>
+                            <div class="search-item">
+                                <span class="label">房间:</span>
+                                <el-input v-model="search.fangJian" size="mini" placeholder="请输入" @keyup.enter.native="goSearch" />
+                            </div>
+                            <div class="search-item">
+                                <span class="label">监测周期:</span>
+                                <el-select v-model="search.zhouQi" placeholder="请选择" size="mini" :clearable="true">
+                                    <el-option
+                                        v-for="item in ['每日','每周','每月','每季度','每半年','每年']"
+                                        :key="item"
+                                        :label="item"
+                                        :value="item"
+                                    />
+                                </el-select>
+                            </div>
+                            <div class="search-item">
+                                <span class="label">监测岗位:</span>
+                                <el-select v-model="search.gangWei" placeholder="请选择" size="mini" :clearable="true">
+                                    <el-option
+                                        v-for="item in jianCeGangWeiList"
+                                        :key="item.id_"
+                                        :label="item.wei_hu_gang_wei_"
+                                        :value="item.wei_hu_gang_wei_"
+                                    />
+                                </el-select>
+                            </div>
+                            <div class="search-item" style="width:70px">
+                                <el-button size="mini" type="primary" icon="el-icon-search" @click="goSearch">查询</el-button>
+                            </div>
+                            <div class="search-item" style="width:68px">
+                                <el-button type="success" size="mini" icon="ibps-icon-plus" @click="openDialog">添加</el-button>
+                            </div>
+                            <div class="search-item" style="width:100px">
+                                <el-button type="info" size="mini" icon="el-icon-setting" @click="settingData">批量配置</el-button>
+                            </div>
+                            <div class="search-item" style="width:70px">
+                                <el-button type="danger" size="mini" icon="ibps-icon-close" @click="removeItem">删除</el-button>
+                            </div>
+                        </div>
+                    </div>
+                    <el-table
+                        :data="showPaperList"
+                        style="width: 100%"
+                        @selection-change="handleSelectionChange"
+                    >
+                        <el-table-column
+                            width="50"
+                            type="selection"
+                        />
+                        <el-table-column
+                            prop=""
+                            label="序号"
+                            width="50"
+                            type="index"
+                            :index="showIndex"
+                        />
+                        <el-table-column
+                            prop="bu_men_"
+                            label="部门"
+                            width="100"
+                        >
+                            <template slot-scope="{row}">
+                                <ibps-user-selector
+                                    type="position"
+                                    :value="row.bu_men_"
+                                    readonly-text="text"
+                                    :disabled="true"
+                                    :multiple="true"
+                                />
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="qu_yu_"
+                            label="区域"
+                        />
+                        <el-table-column
+                            prop="fang_jian_"
+                            label="房间"
+                        />
+                        <el-table-column
+                            v-if="isShowDevice"
+                            prop="deviceno1_"
+                            label="被控设备编号"
+                        />
+                        <el-table-column
+                            v-if="isShowDevice"
+                            prop="devicename1_"
+                            label="被控设备名称"
+                        />
+                        <el-table-column
+                            prop="deviceno2_"
+                            label="监控设备"
+                        />
+                        <el-table-column
+                            prop="jian_ce_zhou_qi_"
+                            label="监测周期"
+                            width="80"
+                        />
+                        <el-table-column
+                            prop="jian_ce_ri_qi_"
+                            label="监测日期"
+                            width="110"
+                        />
+                        <el-table-column
+                            prop="jian_ce_gang_wei_"
+                            label="监测岗位"
+                        />
+                        <el-table-column
+                            prop="shi_fou_qi_yong_"
+                            label="是否启用"
+                            width="80"
+                        >
+                            <template slot-scope="{row}">
+                                <el-tag v-if="row.shi_fou_qi_yong_==='1'">启用</el-tag>
+                                <el-tag v-if="row.shi_fou_qi_yong_==='0'" type="danger">停用</el-tag>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            fixed="right"
+                            prop=""
+                            label="操作栏目"
+                        >
+                            <template slot-scope="{row}">
+                                <el-button type="primary" icon="el-icon-edit" size="mini" @click="openDialog(row)">编辑</el-button>
+                            </template>
+                        </el-table-column>
+                    </el-table>
+                    <el-pagination
+                        style="margin-top: 5px; padding-bottom: 10px"
+                        :current-page="currentPage"
+                        :page-sizes="[10, 20,30, 50]"
+                        :page-size="pageSize"
+                        layout="prev,pager,next,jumper,sizes,->,total"
+                        :total="trueList.length"
+                        @size-change="handleSizeChange"
+                        @current-change="handleCurrentChange"
+                    />
+                </div>
+            </div>
+            <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>
+    </el-dialog>
+</template>
+
+<script>
+import { getSetting } from '@/utils/query'
+import ibpsUserSelector from '@/business/platform/org/selector'
+import xlsx from 'xlsx'
+import fs from 'file-saver'
+import FecDialog from './fecDialog.vue'
+import FacilityData from '@/views/component/facility/facilityData.vue'
+import DefaultSettingDialog from './defaultSettingDialog.vue'
+export default {
+    components: {
+        DefaultSettingDialog,
+        FacilityData,
+        ibpsUserSelector,
+        FecDialog,
+        IbpsCustomDialog: () => import('@/business/platform/data/templaterender/custom-dialog')
+    },
+    props: {
+        parentData: {
+            type: [Object, Array],
+            default: () => {}
+        },
+        visible: {
+            type: Boolean,
+            default: false
+        }
+    },
+    data () {
+        const { userId, level = {}, position } = this.$store.getters || {}
+        return {
+            defultdialogVisible: false,
+            filter: [{
+                descVal: '1',
+                includeSub: true,
+                old: 'position',
+                partyId: this.$store.getters.userInfo.employee.positions,
+                partyName: '',
+                scriptContent: '',
+                type: 'user',
+                userType: 'position'
+            }],
+            search: {
+                buMen: '',
+                quYu: '',
+                fangJian: '',
+                gangWei: '',
+                zhouQi: ''
+            },
+            searchData: [],
+            isSearch: false,
+            level: level.second || level.first,
+            userId: userId,
+            pageSize: 10,
+            currentPage: 1,
+            multipleSelection: [],
+            nextDate: '',
+            rules: {
+                lei_xing_: [
+                    { required: true, message: '请选择类型', trigger: 'blur' }
+                ]
+            },
+            jianCeGangWeiList: [],
+            dialogVisible: true,
+            subDialogVisible: false,
+            title: '设施环境配置表',
+            toolbars: [{ key: 'save', label: '保存' }, { key: 'cancel', label: '退出', type: 'danger', icon: 'ibps-icon-close' }],
+            dayCheck: [],
+            weekCheck: '',
+            monthCheck: '',
+            quarterCheck: '',
+            halfYearCheck: '',
+            yearCheck: '',
+            sepCheck: '',
+            form: {
+                di_dian_: level.second || level.first,
+                bian_zhi_ren_: userId,
+                lei_xing_: '',
+                bian_zhi_bu_men_: position && position.split(',')[0],
+                zhou_qi_: '',
+                gang_wei_: '',
+                tiao_jian_: '',
+                she_bei_bian_hao_: '', // 设备编号
+                jian_ce_ri_qi_: '',
+                ri_qi_lie_biao_: '',
+                mo_kuai_lu_jing_: '',
+                lie_biao_shu_ju_: '',
+                kai_shi_shi_jian_: '',
+                kong_zhi_biao_zhu: ''
+            },
+            subForm: [
+
+            ],
+            period: [
+                { label: '日监测', value: '每日' },
+                { label: '周监测', value: '每周' },
+                { label: '月监测', value: '每月' },
+                { label: '季度监测', value: '每季度' },
+                { label: '半年监测', value: '每半年' },
+                { label: '年监测', value: '每年' }
+            ],
+            config: {
+                '01-室内温湿度监控': {
+                    label: '室内温湿度监控',
+                    path: '/sshjgl/wdjc/snwsdjkcd',
+                    showDevice: false
+                },
+                '02-冰箱温度监控': {
+                    label: '冰箱温度监控',
+                    path: '/sshjgl/wdjc/bxwdjc',
+                    showDevice: true
+                },
+                '03-温浴箱温度监控': {
+                    label: '温浴箱温度监控',
+                    path: '/sshjgl/wdjc/wyxwdjkywh',
+                    showDevice: true
+                },
+                '04-阴凉柜温度监控': {
+                    label: '阴凉柜温度监控',
+                    path: '/sshjgl/wdjc/ylgwdjc',
+                    showDevice: true
+                },
+                '05-纯水机水质监测': {
+                    label: '纯水机水质监测',
+                    path: '/sshjgl/csjszjcb',
+                    showDevice: true
+                },
+                '06-每日安全检查': {
+                    label: '每日安全检查',
+                    path: '/sshjgl/aqgl/mraqjc',
+                    showDevice: false
+                },
+                '07-每月安全检查': {
+                    label: '每月安全检查',
+                    path: '/sshjgl/aqgl/myaqjc',
+                    showDevice: true
+                },
+                '08-含氯有效性监测': {
+                    label: '含氯有效性监测',
+                    path: '/sshjgl/aqgl/hlyxxjc',
+                    showDevice: false
+                },
+                // '09-紫外灯辐照测定': {
+                //     path: '/sshjgl/aqgl/zwdfzd',
+                // },
+                '10-洗眼器检查': {
+                    label: '洗眼器检查',
+                    path: '/sshjgl/aqgl/xyqjc',
+                    showDevice: true
+                },
+                '11-紧急淋浴器检查': {
+                    label: '紧急淋浴器检查',
+                    path: '/sshjgl/aqgl/jjlyqjc',
+                    showDevice: true
+                },
+                '12-紫外灯消毒': {
+                    label: '紫外灯消毒',
+                    path: '/sshjgl/aqgl/jykzwdxdjlb',
+                    showDevice: true
+                },
+                '13-高压灭菌': {
+                    label: '高压灭菌',
+                    path: '/sshjgl/aqgl/gymjjlb',
+                    showDevice: true
+                },
+                '14-空气消毒机': {
+                    label: '空气消毒机',
+                    path: '/sshjgl/aqgl/xdjsyjlb',
+                    showDevice: true
+                },
+                '15-日常防护消毒': {
+                    label: '日常防护消毒',
+                    path: '/sshjgl/aqgl/rcfhxd',
+                    showDevice: false
+                },
+                '16-设备排出废液': {
+                    label: '设备排出废液',
+                    path: '/sshjgl/aqgl/sbpcfyxd',
+                    showDevice: true
+                }
+            },
+            subIdList: [],
+            isFirstLieBiao: true
+        }
+    },
+    computed: {
+        // 分页结果
+        showPaperList () {
+            const start = (this.currentPage - 1) * this.pageSize
+            const end = start + this.pageSize
+            return this.trueList.slice(start, end)
+        },
+        // 过滤结果
+        trueList () {
+            return this.isSearch ? this.searchData : this.subForm
+        },
+        isShowDevice () {
+            return this.config[this.form.lei_xing_]?.showDevice
+        },
+        deviceIsRequired () {
+            return this.form.lei_xing_ === '02-冰箱温度监控' || this.form.lei_xing_ === '05-纯水机水质监测' || this.form.lei_xing_ === '03-温浴箱温度监控' || this.form.lei_xing_ === '04-阴凉柜温度监控' || this.form.lei_xing_ === '16-设备排出废液'
+        },
+        isEdit () {
+            return !!(this.parentData instanceof Object && this.parentData.mainId)
+        }
+    },
+    watch: {
+        'form.lei_xing_' (val) {
+            if (this.isEdit) return
+            this.form.mo_kuai_lu_jing_ = this.config[val].path
+            if (!this.isFirstLieBiao) {
+                this.subForm = []
+                switch (val) {
+                    case '01-室内温湿度监控':
+                        this.form.lie_biao_shu_ju_ = JSON.stringify([
+                            { label: '上午温度', range: [], fixValue: '', value: '', result: '', status: '', unit: '℃' },
+                            { label: '上午湿度', range: [], fixValue: '', value: '', result: '', status: '', unit: '%' },
+                            { label: '下午温度', range: [], fixValue: '', value: '', result: '', status: '', unit: '℃' },
+                            { label: '下午湿度', range: [], fixValue: '', value: '', result: '', status: '', unit: '%' }
+                        ])
+                        break
+                    case '02-冰箱温度监控':
+                        this.form.lie_biao_shu_ju_ = JSON.stringify([
+                            { label: '冷藏', range: [], fixValue: '', value: '', result: '', status: '', unit: '℃' },
+                            { label: '冷冻', range: [], fixValue: '', value: '', result: '', status: '', unit: '℃' }
+                        ])
+                        break
+                    case '03-温浴箱温度监控':
+                        this.form.lie_biao_shu_ju_ = JSON.stringify([
+                            { label: '温度', range: [], fixValue: '', value: '', result: '', status: '', unit: '℃' }
+                        ])
+                        break
+                    case '04-阴凉柜温度监控':
+                        this.form.lie_biao_shu_ju_ = JSON.stringify([
+                            { label: '温度', range: [], fixValue: '', value: '', result: '', status: '', unit: '℃' }
+                        ])
+                        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:
+                        this.form.lie_biao_shu_ju_ = ''
+                        break
+                }
+            }
+        }
+    },
+    async mounted () {
+        const config = await getSetting('facilityEnv', 'typeList')
+        if (config) {
+            console.debug(config)
+            this.config = config
+        }
+        this.init()
+        if (this.isEdit) {
+            this.loadData()
+            this.loadSubData()
+        } else {
+            this.isFirstLieBiao = false
+        }
+    },
+    methods: {
+        init () {
+            this.loadSelectorData()
+        },
+        loadSelectorData () {
+            const pos = this.$store.getters.level.second ? this.$store.getters.level.second : this.$store.getters.level.first
+            const sql = `select * from t_sbwhgwpzb where di_dian_='${pos}'`
+            this.$common.request('sql', sql).then(res => {
+                const { data = [] } = res.variables || {}
+                this.jianCeGangWeiList = data
+            })
+        },
+        loadData () {
+            const sql = `select * from t_sshjpzb where id_='${this.parentData.mainId}'`
+            this.$common.request('sql', sql).then(res => {
+                const { data = [] } = res.variables || {}
+                // console.log('主表', data)
+                if (!data.length) {
+                    return this.$message.warning(``)
+                }
+                Object.assign(this.form, data[0])
+                // this.form = data[0]
+                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_) {
+                    this.$nextTick(() => {
+                        switch (this.form.zhou_qi_) {
+                            case '每日':
+                                if (jian_ce_ri_qi_ === '每天') {
+                                    this.dayCheck = [1, 2, 3, 4, 5, 6, 7]
+                                } else {
+                                    this.dayCheck = jian_ce_ri_qi_.split('每周')[1].split(',').map(item => +item)
+                                }
+                                break
+                            case '每周':
+                                this.weekCheck = +jian_ce_ri_qi_.split('每周')[1]
+                                break
+                            case '每月':
+                                this.monthCheck = +jian_ce_ri_qi_.split('每个月第')[1].split('天')[0]
+                                break
+                            case '每季度':
+                                this.quarterCheck = +jian_ce_ri_qi_.split('每季度第')[1].split('个月')[0]
+                                break
+                            case '每半年':
+                                this.halfYearCheck = +jian_ce_ri_qi_.split('每半年第')[1].split('个月')[0]
+                                break
+                            case '每年':
+                                this.yearCheck = +jian_ce_ri_qi_.split('每年第')[1].split('个月')[0]
+                                break
+                            case '间隔':
+                                this.sepCheck = +ri_qi_lie_biao_
+                                break
+                            default:
+                                break
+                        }
+                    })
+                }
+                this.$nextTick(() => {
+                    this.isFirstLieBiao = false
+                })
+            })
+        },
+        loadSubData () {
+            const sql = `select * from t_sshjpzxq where parent_id_='${this.parentData.mainId}'`
+            this.$common.request('sql', sql).then(res => {
+                const { data = [] } = res.variables || {}
+                // console.log('子表', data)
+                if (!data.length) {
+                    return this.$message.warning(``)
+                }
+                this.subForm = data
+                this.subIdList = data.map(item => item.zi_wai_deng_wai_j)
+            })
+        },
+        handleSetting (type) {
+            this.form = this.$refs.DefaultSettingDialogRef.form
+            if (this.subForm.length === 0) return this.$message.warning('配置详情列表中无数据,请先添加数据!')
+            if (type === 'settingEmpty') this.settingEmpty()
+            else if (type === 'settingAll') this.settingAll()
+            this.defultdialogVisible = false
+        },
+        // 使用默认数据
+        settingData () {
+            if (this.form.lei_xing_ === '') {
+                return this.$message.warning('请先选择类型!')
+            }
+            this.defultdialogVisible = true
+        },
+        settingAll () {
+            this.subForm.forEach(item => {
+                item.bu_men_ = this.form.bian_zhi_bu_men_
+                item.jian_ce_gang_wei_ = this.form.gang_wei_
+                item.kong_zhi_tiao_jia = this.form.tiao_jian_
+                item.kong_zhi_biao_zhu = this.form.kong_zhi_biao_zhu
+                item.jian_ce_ri_qi_ = this.form.jian_ce_ri_qi_
+                item.ri_qi_lie_biao_ = this.form.ri_qi_lie_biao_
+                item.jian_ce_zhou_qi_ = this.form.zhou_qi_
+                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 () {
+            this.subForm.forEach(item => {
+                if (item.bu_men_ === '') {
+                    item.bu_men_ = this.form.bian_zhi_bu_men_
+                }
+                if (item.jian_ce_gang_wei_ === '') {
+                    item.jian_ce_gang_wei_ = this.form.gang_wei_
+                }
+                if (item.kong_zhi_tiao_jia === '') {
+                    item.kong_zhi_tiao_jia = this.form.tiao_jian_
+                }
+                if (item.kong_zhi_biao_zhu === '') {
+                    item.kong_zhi_biao_zhu = this.form.kong_zhi_biao_zhu
+                }
+                if (item.jian_ce_ri_qi_ === '') {
+                    item.jian_ce_ri_qi_ = this.form.jian_ce_ri_qi_
+                }
+                if (item.ri_qi_lie_biao_ === '') {
+                    item.ri_qi_lie_biao_ = this.form.ri_qi_lie_biao_
+                }
+                if (item.jian_ce_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 (item.lie_biao_shu_ju_) {
+                        const main = JSON.parse(this.form.lie_biao_shu_ju_)
+                        const sub = JSON.parse(item.lie_biao_shu_ju_)
+                        if (sub.length === 0) {
+                            item.lie_biao_shu_ju_ = JSON.stringify(sub)
+                        }
+                        if (sub.length > 0) {
+                            sub.forEach((i, index) => {
+                                if (i.label === main[index].label && (i.range.length === 0 || i.range.join(',') === [null, null].join(',') || i.range.join(',') === ['', ''].join(','))) {
+                                    i.range = main[index].range
+                                }
+                                if (i.label === main[index].label && i.fixValue === '') {
+                                    i.fixValue = main[index].fixValue
+                                }
+                                if (i.label === main[index].label && i.unit === '') {
+                                    i.unit = main[index].unit
+                                }
+                            })
+                            item.lie_biao_shu_ju_ = JSON.stringify(sub)
+                        } else {
+                            item.lie_biao_shu_ju_ = this.form.lie_biao_shu_ju_
+                        }
+                    } else {
+                        item.lie_biao_shu_ju_ = this.form.lie_biao_shu_ju_
+                    }
+                }
+            })
+            this.$message.success('空值批量替换成功!')
+            this.defultdialogVisible = false
+        },
+        // 当前页码改变
+        handleCurrentChange (val) {
+            this.currentPage = val
+        },
+        // 页码选择器改变
+        handleSizeChange (val) {
+            this.pageSize = val
+            this.currentPage = 1
+        },
+        // 分页连续序号
+        showIndex (index) {
+            return index + 1 + (this.currentPage - 1) * this.pageSize
+        },
+        handleActionEvent ({ key }) {
+            switch (key) {
+                case 'cancel':
+                    this.dialogVisible = false
+                    break
+                case 'save':
+                    this.saveResult()
+                    break
+                default:
+                    break
+            }
+        },
+        // 子表关闭事件
+        sonClose () {
+            this.subDialogVisible = false
+        },
+        // 子表单添加/编辑按钮
+        openDialog (row) {
+            if (this.form.lei_xing_ === '') {
+                return this.$message.warning('请先选择类型!')
+            }
+            this.subDialogVisible = true
+            this.$nextTick(() => {
+                this.$refs.FecDialogRef.open(row, this.jianCeGangWeiList, this.form)
+            })
+        },
+        // 子表的提交事件
+        sonSubmit (data) {
+            const { form, isEdit } = data
+            if (isEdit) {
+                const sub = this.subForm.find(item => item.zi_wai_deng_wai_j === form.zi_wai_deng_wai_j)
+                if (sub) {
+                    Object.assign(sub, form)
+                }
+            } else {
+                this.subForm.push(form)
+            }
+            this.isEdit && this.goSearch()
+            this.sonClose()
+        },
+        // 关闭当前窗口
+        closeDialog () {
+            this.dialogVisible = false
+            this.$emit('close', false)
+        },
+        // 子表删除
+        removeItem () {
+            if (this.multipleSelection.length === 0) {
+                return this.$message.warning('请选择要删除的数据!')
+            } else {
+                this.$confirm('请确认是否删除所选项?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    this.multipleSelection.forEach(item => {
+                        const index = this.subForm.indexOf(item)
+                        this.subForm.splice(index, 1)
+                    })
+                    this.isEdit && this.goSearch()
+                    this.$message.success('删除成功!')
+                    this.multipleSelection = []
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消删除'
+                    })
+                })
+            }
+        },
+        // table复选框
+        handleSelectionChange (val) {
+            this.multipleSelection = val
+        },
+        async submit () {
+            if (this.subForm.length === 0) {
+                return this.$message.warning('请添加子表数据')
+            }
+            for (var i = 0; i < this.subForm.length; i++) {
+                const item = this.subForm[i]
+                if (item.bu_men_ === '') {
+                    return this.$message.warning(`子表第${i + 1}行部门信息缺失!`)
+                }
+                if (item.jian_ce_ri_qi_ === '') {
+                    return this.$message.warning(`子表第${i + 1}行监测日期信息缺失!`)
+                }
+                if (item.jian_ce_gang_wei_ === '') {
+                    return this.$message.warning(`子表第${i + 1}行监测岗位信息缺失!`)
+                }
+                if (this.deviceIsRequired && item.deviceno1_ === '') {
+                    return this.$message.warning(`子表第${i + 1}行设备信息缺失!`)
+                }
+                if (this.form.lei_xing_ === '01-室内温湿度监控' && item.fang_jian_ === '') {
+                    return this.$message.warning(`子表第${i + 1}行房间信息缺失!`)
+                }
+                if (item.lie_biao_shu_ju_) {
+                    const lie_biao_shu_ju_ = JSON.parse(item.lie_biao_shu_ju_)
+                    for (let i = 0; i < lie_biao_shu_ju_.length; i++) {
+                        const item = lie_biao_shu_ju_[i]
+                        if (!item.label && (item.range.length !== 2 || item.range[0] === null || item.range[1] === null) && (!item.fixValue) && (!item.unit)) {
+                            return this.$message.warning(`第${i + 1}行数据非法!`)
+                        }
+                    }
+                }
+            }
+
+            // console.log('主表', this.form)
+            // console.log('子表', this.subForm)
+            const allUid = this.subForm.map(item => item.zi_wai_deng_wai_j)
+            const existUid = this.subIdList
+            const addList = this.subForm.filter(item => !existUid.includes(item.zi_wai_deng_wai_j))
+            const deleteList = existUid.filter(item => !allUid.includes(item))
+            const updateList = this.subForm.filter(item => existUid.includes(item.zi_wai_deng_wai_j))
+            // 主表修改
+            if (this.isEdit) {
+                const params = {
+                    tableName: 't_sshjpzb',
+                    updList: [
+                        {
+                            where: {
+                                id_: this.parentData.mainId
+                            },
+                            param: {
+                                lei_xing_: this.form.lei_xing_,
+                                bian_zhi_bu_men_: this.form.bian_zhi_bu_men_,
+                                zhou_qi_: this.form.zhou_qi_,
+                                gang_wei_: this.form.gang_wei_,
+                                tiao_jian_: this.form.tiao_jian_,
+                                kong_zhi_biao_zhu: this.form.kong_zhi_biao_zhu,
+                                she_bei_bian_hao_: this.form.she_bei_bian_hao_,
+                                jian_ce_ri_qi_: this.form.jian_ce_ri_qi_,
+                                ri_qi_lie_biao_: this.form.ri_qi_lie_biao_,
+                                mo_kuai_lu_jing_: this.form.mo_kuai_lu_jing_,
+                                lie_biao_shu_ju_: this.form.lie_biao_shu_ju_,
+                                kai_shi_shi_jian_: this.form.kai_shi_shi_jian_
+                            }
+
+                        }
+                    ]
+                }
+                await this.$common.request('update', params).then(async () => {
+                    console.log('主表更新数据成功')
+                    if (addList.length) {
+                        const params = {
+                            tableName: 't_sshjpzxq',
+                            paramWhere: addList.map(item => {
+                                return {
+                                    parent_id_: this.parentData.mainId,
+                                    bu_men_: item.bu_men_,
+                                    devicename1_: item.devicename1_,
+                                    deviceno1_: item.deviceno1_,
+                                    deviceid1_: item.deviceid1_,
+                                    deviceno2_: item.deviceno2_,
+                                    deviceid2_: item.deviceid2_,
+                                    fang_jian_: item.fang_jian_,
+                                    fang_jian_id_: item.fang_jian_id_,
+                                    jian_ce_gang_wei_: item.jian_ce_gang_wei_,
+                                    jian_ce_ri_qi_: item.jian_ce_ri_qi_,
+                                    jian_ce_zhou_qi_: item.jian_ce_zhou_qi_,
+                                    kong_zhi_tiao_jia: item.kong_zhi_tiao_jia,
+                                    kong_zhi_biao_zhu: item.kong_zhi_biao_zhu,
+                                    lie_biao_shu_ju_: item.lie_biao_shu_ju_,
+                                    qu_yu_: item.qu_yu_,
+                                    ri_qi_lie_biao_: item.ri_qi_lie_biao_,
+                                    shi_fou_qi_yong_: item.shi_fou_qi_yong_,
+                                    zi_wai_deng_wai_j: item.zi_wai_deng_wai_j,
+                                    kai_shi_shi_jian_: item.kai_shi_shi_jian_
+                                }
+                            })
+                        }
+                        await this.$common.request('add', params).then(() => { console.log('子表添加数据成功') })
+                    }
+                    if (updateList.length) {
+                        const params = {
+                            tableName: 't_sshjpzxq',
+                            updList: updateList.map(item => ({
+                                where: {
+                                    zi_wai_deng_wai_j: item.zi_wai_deng_wai_j
+                                },
+                                param: {
+                                    qu_yu_: item.qu_yu_,
+                                    fang_jian_: item.fang_jian_,
+                                    fang_jian_id_: item.fang_jian_id_,
+                                    bu_men_: item.bu_men_,
+                                    deviceno1_: item.deviceno1_,
+                                    deviceid1_: item.deviceid1_,
+                                    devicename1_: item.devicename1_,
+                                    deviceno2_: item.deviceno2_, // 监控设备
+                                    deviceid2_: item.deviceid2_,
+                                    jian_ce_zhou_qi_: item.jian_ce_zhou_qi_,
+                                    jian_ce_gang_wei_: item.jian_ce_gang_wei_,
+                                    shi_fou_qi_yong_: item.shi_fou_qi_yong_,
+                                    kong_zhi_tiao_jia: item.kong_zhi_tiao_jia,
+                                    kong_zhi_biao_zhu: item.kong_zhi_biao_zhu,
+                                    jian_ce_ri_qi_: item.jian_ce_ri_qi_,
+                                    ri_qi_lie_biao_: item.ri_qi_lie_biao_,
+                                    lie_biao_shu_ju_: item.lie_biao_shu_ju_,
+                                    kai_shi_shi_jian_: item.kai_shi_shi_jian_
+                                }
+                            }))
+                        }
+                        await this.$common.request('update', params).then(() => { console.log('子表更新数据成功') })
+                    }
+                    if (deleteList.length) {
+                        const params = {
+                            tableName: 't_sshjpzxq',
+                            paramWhere: { zi_wai_deng_wai_j: deleteList.join(',') }
+                        }
+                        await this.$common.request('delete', params).then(() => { console.log('子表删除数据成功') })
+                    }
+                    this.$nextTick(() => {
+                        this.$message.success('修改成功!')
+                        this.closeDialog()
+                    })
+                })
+            } else {
+                const params = {
+                    tableName: 't_sshjpzb',
+                    paramWhere: [{
+                        ...this.form
+                    }]
+                }
+                await this.$common.request('add', params).then(async (res) => {
+                    console.log('主表新增数据成功')
+                    const { cont = [] } = res.variables || {}
+                    if (addList.length) {
+                        const params = {
+                            tableName: 't_sshjpzxq',
+                            paramWhere: addList.map(item => {
+                                return {
+                                    parent_id_: cont[0].id_,
+                                    bu_men_: item.bu_men_,
+                                    devicename1_: item.devicename1_,
+                                    deviceno1_: item.deviceno1_,
+                                    deviceid1_: item.deviceid1_,
+                                    deviceno2_: item.deviceno2_,
+                                    deviceid2_: item.deviceid2_,
+                                    fang_jian_: item.fang_jian_,
+                                    fang_jian_id_: item.fang_jian_id_,
+                                    jian_ce_gang_wei_: item.jian_ce_gang_wei_,
+                                    jian_ce_ri_qi_: item.jian_ce_ri_qi_,
+                                    jian_ce_zhou_qi_: item.jian_ce_zhou_qi_,
+                                    kong_zhi_tiao_jia: item.kong_zhi_tiao_jia,
+                                    kong_zhi_biao_zhu: item.kong_zhi_biao_zhu,
+                                    lie_biao_shu_ju_: item.lie_biao_shu_ju_,
+                                    qu_yu_: item.qu_yu_,
+                                    ri_qi_lie_biao_: item.ri_qi_lie_biao_,
+                                    shi_fou_qi_yong_: item.shi_fou_qi_yong_,
+                                    zi_wai_deng_wai_j: item.zi_wai_deng_wai_j,
+                                    kai_shi_shi_jian_: item.kai_shi_shi_jian_
+                                }
+                            })
+                        }
+                        await this.$common.request('add', params).then(() => {
+                            this.$message.success('添加成功!')
+                            console.log('子表添加数据成功')
+                            this.closeDialog()
+                        })
+                    }
+                })
+            }
+
+            // 紫外灯数据同步更新紫外灯消毒记录表
+            if (this.form.lei_xing_.includes('12')) {
+                const tableName = 't_jykzwdxdjlbsc'
+                // 生成添加请求参数
+                const addParams = addList.length ? {
+                    tableName,
+                    paramWhere: addList.map(item => ({
+                        di_dian_: this.level,
+                        bian_zhi_bu_men_: item.bu_men_,
+                        bian_zhi_ren_: this.userId,
+                        zi_wai_deng_ming_: item.devicename1_,
+                        she_shi_id_: item.zi_wai_deng_wai_j,
+                        gang_wei_: item.jian_ce_gang_wei_,
+                        shi_fou_ting_yong: item.shi_fou_qi_yong_
+                    }))
+                } : null
+
+                // 生成更新请求参数
+                const updateParams = updateList.length ? {
+                    tableName,
+                    updList: updateList.map(item => ({
+                        where: {
+                            she_shi_id_: item.zi_wai_deng_wai_j
+                        },
+                        param: {
+                            bian_zhi_bu_men_: item.bu_men_,
+                            zi_wai_deng_ming_: item.devicename1_,
+                            gang_wei_: item.jian_ce_gang_wei_,
+                            shi_fou_ting_yong: item.shi_fou_qi_yong_
+                        }
+                    }))
+                } : null
+
+                // 生成删除请求参数
+                const deleteParams = deleteList.length ? {
+                    tableName,
+                    paramWhere: { she_shi_id_: deleteList.join(',') }
+                } : null
+
+                // 合并所有请求
+                const allRequests = []
+
+                if (addParams) {
+                    allRequests.push(this.$common.request('add', addParams).then(() => console.log('添加紫外灯数据成功')))
+                }
+
+                if (updateParams) {
+                    allRequests.push(this.$common.request('update', updateParams).then(() => console.log('更新紫外灯数据成功')))
+                }
+
+                if (deleteParams) {
+                    allRequests.push(this.$common.request('delete', deleteParams).then(() => console.log('删除紫外灯数据成功')))
+                }
+
+                // 执行所有请求
+                await Promise.all(allRequests)
+                    .then(() => console.log('所有请求完成'))
+                    .catch(error => console.error('请求出错:', error))
+            }
+        },
+        saveResult () {
+            this.$refs.form.validate((valid) => {
+                if (valid) {
+                    this.submit()
+                } else {
+                    this.$message.warning('请填写必填项')
+                    return false
+                }
+            })
+        },
+        // 查询
+        goSearch () {
+            console.log(this.search)
+            if (!this.search.buMen && !this.search.quYu && !this.search.fangJian && !this.search.zhouQi && !this.search.gangWei) {
+                this.isSearch = false
+            } else {
+                // 条件过滤
+                const searchData = this.subForm
+                    .filter(item => item.bu_men_.indexOf(this.search.buMen) > -1)
+                    .filter(item => item.qu_yu_.indexOf(this.search.quYu) > -1)
+                    .filter(item => item.fang_jian_.indexOf(this.search.fangJian) > -1)
+                    .filter(item => item.jian_ce_zhou_qi_.indexOf(this.search.zhouQi) > -1)
+                    .filter(item => item.jian_ce_gang_wei_.indexOf(this.search.gangWei) > -1)
+                this.isSearch = true
+                this.searchData = searchData
+            }
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.sub-dialog{
+    .contain{
+        padding: 20px;
+    }
+}
+.paper-detail-dialog {
+    ::v-deep {
+        .el-dialog__header {
+            text-align: center;
+        }
+    }
+    .dialog-title{
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    div{
+        position: absolute;
+        right:8vw;
+    }
+    .dialogtitle{
+        font-size: 22px;
+        font-family: SimHei;
+        font-weight: bold;
+        color: #222;
+    }
+}
+.container {
+        display: flex;
+        width: 100%;
+        justify-content: center;
+        .el-row{
+            margin: 0 !important;
+        }
+        .required{
+            color: #606266 !important;
+            &::before{
+                content: '*';
+                margin: 0 4px 0 -7.5px;
+                color: #F56C6C;
+            }
+        }
+        .main{
+            width: 80%;
+            height: calc(100vh - 100px);
+            box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+            padding:20px;
+            overflow-y: auto;
+            .form{
+                .el-row{
+                    margin: 10px 0;
+                }
+            }
+        }
+        .table{
+            margin-top: 20px;
+           .el-alert{
+             margin-bottom: 20px;
+           }
+            .search{
+                display: flex;
+                flex-wrap: wrap;
+                align-items: center;
+                .search-item{
+                    .label{
+                        font-size: 12px;
+                        min-width: 74px;
+                    }
+                    display: flex;
+                    align-items: center;
+                    width: 240px;
+                    margin: 0 10px 8px 0;
+                }
+            }
+        }
+
+    }
+}
+    ::v-deep {
+        .el-form-item__label{
+            text-align: left
+        }
+        .el-form-item__content{
+            font-size: 12px !important;
+            display: flex;
+         }
+    }
+</style>

+ 803 - 0
src/views/system/fasc/fecDialog.vue

@@ -0,0 +1,803 @@
+<template>
+    <el-dialog
+        :title="title+(isEdit===true?'--编辑':'--新增')"
+        :visible.sync="dialogVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        append-to-body
+        class="dialog paper-detail-dialog"
+        width="65%"
+        top
+        style="margin-top:5vh"
+        :show-close="false"
+    >
+        <div class="contain">
+            <div class="main">
+                <el-form ref="form" :model="form" label-width="120px">
+                    <el-row>
+                        <el-col :span="12">
+                            <el-form-item label="部门:">
+                                <template slot="label">
+                                    <span class="required">部门:</span>
+                                </template>
+                                <ibps-user-selector
+                                    v-model="form.bu_men_"
+                                    size="mini"
+                                    type="position"
+                                    readonly-text="text"
+                                    :disabled="false"
+                                    :multiple="false"
+                                    style="width:80%"
+                                    :filter="filter"
+                                    filtrate
+                                />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="12">
+                            <el-form-item label="监测岗位:">
+                                <template slot="label">
+                                    <span class="required">监测岗位:</span>
+                                </template>
+                                <el-select v-model="form.jian_ce_gang_wei_" placeholder="请选择" size="mini" style="width:80%">
+                                    <el-option
+                                        v-for="item in monitoringpPosition"
+                                        :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 v-if="lei_xing_!=='01-室内温湿度监控'" label="房间:">
+                                <ibps-link-data
+                                    v-model="form.fang_jian_"
+                                    style="width:80%"
+                                    size="mini"
+                                    template-key="fjzly"
+                                    :multiple="false"
+                                    :temp-search="true"
+                                    label-key="fang_jian_ming_ha"
+                                    value-key="fang_jian_ming_ha"
+                                    :allow-create="false"
+                                    :filterable="false"
+                                    @change-link-data="fangJianChange"
+                                />
+                            </el-form-item>
+                            <el-form-item v-else label="房间:">
+                                <template slot="label">
+                                    <span class="required">房间:</span>
+                                </template>
+                                <ibps-link-data
+                                    v-model="form.fang_jian_"
+                                    style="width:80%"
+                                    size="mini"
+                                    template-key="fjzly"
+                                    :multiple="false"
+                                    :temp-search="true"
+                                    label-key="fang_jian_ming_ha"
+                                    value-key="fang_jian_ming_ha"
+                                    :allow-create="false"
+                                    :filterable="false"
+                                    @change-link-data="fangJianChange"
+                                />
+                            </el-form-item>
+                        </el-col>
+                        <el-col v-show="form.qu_yu_" :span="12">
+                            <el-form-item label="区域:">
+                                <template slot="label">
+                                    <span>区域</span>
+                                    <el-tooltip effect="dark" content="区域由房间自动带出" placement="top">
+                                        <i class="el-icon-question question-icon">:</i>
+                                    </el-tooltip>
+                                </template>
+                                <span>{{ form.qu_yu_ }}</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row>
+                        <el-col :span="12">
+                            <el-form-item label="监控设备:">
+                                <ibps-link-data
+                                    v-model="form.deviceno2_"
+                                    style="width:80%"
+                                    size="mini"
+                                    template-key="jksbxz"
+                                    :multiple="false"
+                                    :temp-search="true"
+                                    label-key="deviceInfo"
+                                    value-key="deviceInfo"
+                                    :allow-create="false"
+                                    :filterable="false"
+                                    @change-link-data="deviceno2Change"
+                                />
+                            </el-form-item>
+                        </el-col>
+
+                    </el-row>
+                    <el-row v-if="isShowDevice">
+                        <el-col :span="12">
+                            <el-form-item v-if="deviceIsRequired" label="被控设备/设施编号:" label-width="140">
+                                <template slot="label">
+                                    <span class="required">被控设备/设施编号:</span>
+                                </template>
+                                <ibps-custom-dialog
+                                    v-model="form.deviceno1_"
+                                    size="mini"
+                                    template-key="sbxzmcgl"
+                                    :multiple="false"
+                                    :disabled="false"
+                                    type="dialog"
+                                    class="custom-dialog"
+                                    placeholder="请选择设备"
+                                    icon="el-icon-search"
+                                    style="width:80%"
+                                    @change-link-data="deviceno1Change"
+                                />
+                            </el-form-item>
+                            <el-form-item v-else label="被控设备/设施编号:" label-width="140">
+                                <ibps-link-data
+                                    v-model="form.deviceno1_"
+                                    style="width:80%"
+                                    size="mini"
+                                    template-key="sbxzsshj"
+                                    :multiple="false"
+                                    :temp-search="true"
+                                    label-key="yuan_she_bei_bian"
+                                    value-key="yuan_she_bei_bian"
+                                    :allow-create="false"
+                                    :filterable="false"
+                                    @change-link-data="deviceno1Change"
+                                />
+                            </el-form-item>
+                        </el-col>
+                        <el-col v-show="form.deviceno1_" :span="12">
+                            <el-form-item v-if="deviceIsRequired" label="被控设备/设施名称:" label-width="140">
+                                <template slot="label">
+                                    <span>被控设备/设施名称</span>
+                                    <el-tooltip effect="dark" content="选择设备后自动带出名称" placement="top">
+                                        <i class="el-icon-question question-icon">:</i>
+                                    </el-tooltip>
+                                </template>
+                                <div>{{ form.devicename1_ }}</div>
+                            </el-form-item>
+                            <el-form-item v-else label="被控设备/设施名称:" label-width="140">
+                                <el-input v-model="form.devicename1_" size="mini" style="width:80%" />
+                            </el-form-item>
+                        </el-col>
+
+                    </el-row>
+
+                    <el-row>
+                        <el-col :span="12">
+                            <el-form-item label="监测周期:">
+                                <template slot="label">
+                                    <span class="required">监测周期:</span>
+                                </template>
+                                <el-select v-model="form.jian_ce_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-col :span="12">
+                            <el-form-item label="是否启用:">
+                                <template slot="label">
+                                    <span>是否启用</span>
+                                    <el-tooltip effect="dark" content="若该值为停用时,将不会按监测周期产生对应记录。" placement="top">
+                                        <i class="el-icon-question question-icon">:</i>
+                                    </el-tooltip>
+                                </template>
+                                <div class="qiyong">
+                                    <el-radio v-model="form.shi_fou_qi_yong_" label="1">启用</el-radio>
+                                    <el-radio v-model="form.shi_fou_qi_yong_" label="0">停用</el-radio>
+                                </div>
+
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row v-if="form.jian_ce_zhou_qi_!==''">
+                        <el-col :span="12">
+                            <el-form-item :label="labelShow">
+                                <template slot="label">
+                                    <span class="required">{{ labelShow }}</span>
+                                </template>
+                                <el-checkbox-group v-if="form.jian_ce_zhou_qi_==='每日'" v-model="dayCheck" size="mini">
+                                    <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.jian_ce_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.jian_ce_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.jian_ce_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.jian_ce_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.jian_ce_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-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-col>
+                        <el-col v-if="nextDate" :span="12">
+                            <el-form-item label="下次监测日期为:">
+                                <el-tag size="mini" class="eltag">{{ nextDate }}</el-tag>
+                            </el-form-item>
+                        </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-col :span="12">
+                            <el-form-item label="控制条件:">
+                                <el-input v-model="form.kong_zhi_tiao_jia" type="textarea" :rows="2" size="mini" style="width:80%" />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="12">
+                            <el-form-item label="控制标准:">
+                                <el-input v-model="form.kong_zhi_biao_zhu" 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_" :is-cul="false" :form-data="{lieBiaoShuJu:form.lie_biao_shu_ju_}" @change-data="onFacilityData" />
+                        </el-col>
+                    </el-row>
+                </el-form>
+            </div>
+        </div>
+        <span slot="footer" class="dialog-footer">
+            <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>
+    </el-dialog>
+</template>
+
+<script>
+import ibpsUserSelector from '@/business/platform/org/selector'
+import IbpsLinkData from '@/business/platform/data/templaterender/link-data'
+import FacilityData from '@/views/component/facility/facilityData.vue'
+
+export default {
+    components: {
+        FacilityData,
+        ibpsUserSelector,
+        IbpsLinkData,
+        IbpsCustomDialog: () => import('@/business/platform/data/templaterender/custom-dialog')
+
+    },
+    data () {
+        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: [{
+                descVal: '1',
+                includeSub: true,
+                old: 'position',
+                partyId: this.$store.getters.userInfo.employee.positions,
+                partyName: '',
+                scriptContent: '',
+                type: 'user',
+                userType: 'position'
+            }],
+            dialogVisible: true,
+            title: '配置详情',
+            jianCeGangWeiList: [],
+            lei_xing_: '',
+            form: {
+                qu_yu_: '',
+                fang_jian_: '',
+                fang_jian_id_: '',
+                bu_men_: '',
+                deviceno1_: '',
+                deviceid1_: '', // 设备id
+                devicename1_: '',
+                deviceno2_: '', // 监控设备
+                deviceid2_: '', // 监控设备id
+                jian_ce_zhou_qi_: '',
+                jian_ce_gang_wei_: '',
+                shi_fou_qi_yong_: '1',
+                kong_zhi_tiao_jia: '',
+                kong_zhi_biao_zhu: '',
+                jian_ce_ri_qi_: '',
+                ri_qi_lie_biao_: '',
+                zi_wai_deng_wai_j: '', // 紫外灯外键
+                lie_biao_shu_ju_: '',
+                kai_shi_shi_jian_: ''
+            },
+            isEdit: false,
+            nextDate: '',
+            dayCheck: [],
+            weekCheck: '',
+            monthCheck: '',
+            quarterCheck: '',
+            halfYearCheck: '',
+            yearCheck: '',
+            sepCheck: '',
+            period: [
+                { label: '日监测', value: '每日' },
+                { label: '周监测', value: '每周' },
+                { label: '月监测', value: '每月' },
+                { label: '季度监测', value: '每季度' },
+                { label: '半年监测', value: '每半年' },
+                { label: '年监测', value: '每年' },
+                { label: '按时间间隔监测', value: '间隔' }
+            ]
+        }
+    },
+    computed: {
+        monitoringpPosition () {
+            return this.jianCeGangWeiList.filter(i => i.suo_shu_bu_men_ === this.form.bu_men_)
+        },
+        isShowDevice () {
+            return this.lei_xing_ !== '01-室内温湿度监控' && this.lei_xing_ !== '06-每日安全检查' && this.lei_xing_ !== '08-含氯有效性监测' && this.lei_xing_ !== '15-日常防护消毒'
+        },
+        deviceIsRequired () {
+            return this.lei_xing_ === '02-冰箱温度监控' || this.lei_xing_ === '05-纯水机水质监测' || this.lei_xing_ === '03-温浴箱温度监控' || this.lei_xing_ === '04-阴凉柜温度监控' || this.lei_xing_ === '16-设备排出废液'
+        },
+        labelShow () {
+            if (this.form.jian_ce_zhou_qi_) {
+                if (this.form.jian_ce_zhou_qi_ !== '间隔') {
+                    return this.form.jian_ce_zhou_qi_.split('每')[1] + '监测日期:'
+                }
+                return '间隔时间:'
+            }
+            return ''
+        }
+    },
+    watch: {
+        'form.jian_ce_zhou_qi_' (val, old) {
+            if (!old) return
+            this.dayCheck = []
+            this.weekCheck = ''
+            this.monthCheck = ''
+            this.quarterCheck = ''
+            this.halfYearCheck = ''
+            this.yearCheck = ''
+            this.sepCheck = ''
+            this.nextDate = ''
+            this.form.kai_shi_shi_jian_ = ''
+        },
+        dayCheck: {
+            handler: function (val, oldVal) {
+                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) {
+                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) {
+                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) {
+                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) {
+                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) {
+                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
+        }
+    },
+    methods: {
+        deviceno1Change (key, data) {
+            this.form.deviceid1_ = data.id_
+            this.form.devicename1_ = data.she_bei_ming_cheng_
+        },
+        deviceno2Change (key, data) {
+            this.form.deviceid2_ = data.deviceId
+        },
+        fangJianChange (key, data) {
+            this.form.fang_jian_id_ = data.id_
+            this.form.qu_yu_ = data.qu_yu_
+        },
+        // 接收自定义组件数据
+        onFacilityData (...arg) {
+            if (arg.length > 1) {
+                this.form.lie_biao_shu_ju_ = arg[1]
+            }
+        },
+        // 格式化数据
+        formatForm () {
+            // 监测日期格式化
+            switch (this.form.jian_ce_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 {
+                        this.dayCheck.sort(function (a, b) {
+                            return a - b
+                        })
+                        this.form.jian_ce_ri_qi_ = '每周' + this.dayCheck.join(',')
+                        this.form.ri_qi_lie_biao_ = this.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:
+                    break
+            }
+        },
+        checkForm () {
+            if (this.form.bu_men_ === '') {
+                throw new Error('部门信息缺失!')
+            }
+            if (this.form.jian_ce_ri_qi_ === '') {
+                throw new Error('监测日期信息缺失!')
+            }
+            if (this.form.jian_ce_gang_wei_ === '') {
+                throw new Error('监测岗位信息缺失!')
+            }
+            if (this.deviceIsRequired && this.form.deviceno1_ === '') {
+                throw new Error('请先选择设备!')
+            }
+            if (this.lei_xing_ === '01-室内温湿度监控' && this.form.fang_jian_ === '') {
+                throw new Error('室内温湿度类型必须填写房间!')
+            }
+            if (this.form.lie_biao_shu_ju_) {
+                const lie_biao_shu_ju_ = JSON.parse(this.form.lie_biao_shu_ju_)
+                for (let i = 0; i < lie_biao_shu_ju_.length; i++) {
+                    const item = lie_biao_shu_ju_[i]
+                    if (!item.label && (item.range.length !== 2 || item.range[0] === null || item.range[1] === null) && (!item.fixValue) && (!item.unit)) {
+                        throw new Error(`第${i + 1}行数据非法!`)
+                    }
+                }
+            }
+        },
+        submit () {
+            try {
+                this.formatForm()
+                this.checkForm()
+                this.$emit('onSubmit', { form: this.form, isEdit: this.isEdit })
+            } catch (error) {
+                this.$message.warning(error.message)
+            }
+        },
+        close () {
+            this.$emit('onClose')
+        },
+        // 格式化监测日期
+        formatData () {
+            if (this.form.jian_ce_ri_qi_) {
+                this.$nextTick(() => {
+                    switch (this.form.jian_ce_zhou_qi_) {
+                        case '每日':
+                            if (this.form.jian_ce_ri_qi_ === '每天') {
+                                this.dayCheck = [1, 2, 3, 4, 5, 6, 7]
+                            } else {
+                                this.dayCheck = this.form.jian_ce_ri_qi_.split('每周')[1].split(',').map(item => +item)
+                            }
+                            break
+                        case '每周':
+                            this.weekCheck = +this.form.jian_ce_ri_qi_.split('每周')[1]
+                            break
+                        case '每月':
+                            this.monthCheck = +this.form.jian_ce_ri_qi_.split('每个月第')[1].split('天')[0]
+                            break
+                        case '每季度':
+                            this.quarterCheck = +this.form.jian_ce_ri_qi_.split('每季度第')[1].split('个月')[0]
+                            break
+                        case '每半年':
+                            this.halfYearCheck = +this.form.jian_ce_ri_qi_.split('每半年第')[1].split('个月')[0]
+                            break
+                        case '每年':
+                            this.yearCheck = +this.form.jian_ce_ri_qi_.split('每年第')[1].split('个月')[0]
+                            break
+                        case '间隔':
+                            this.sepCheck = +this.form.ri_qi_lie_biao_
+                            break
+                        default:
+                            break
+                    }
+                })
+            }
+        },
+        open (row, jianCeGangWeiList, parentForm) {
+            this.dialogVisible = true
+            this.jianCeGangWeiList = jianCeGangWeiList
+            this.lei_xing_ = parentForm.lei_xing_
+            this.isEdit = !!(row && row.zi_wai_deng_wai_j)
+            // 编辑
+            if (this.isEdit) {
+                // this.form = JSON.parse(JSON.stringify(row))
+                const temp = JSON.parse(JSON.stringify(row))
+                Object.assign(this.form, temp)
+            } else {
+                this.form.zi_wai_deng_wai_j = this.$utils.guid()
+                this.form.bu_men_ = parentForm.bian_zhi_bu_men_
+                this.form.jian_ce_gang_wei_ = parentForm.gang_wei_
+                this.form.jian_ce_ri_qi_ = parentForm.jian_ce_ri_qi_
+                this.form.kong_zhi_tiao_jia = parentForm.tiao_jian_
+                this.form.kong_zhi_biao_zhu = parentForm.kong_zhi_biao_zhu
+                this.form.jian_ce_zhou_qi_ = parentForm.zhou_qi_
+                this.form.ri_qi_lie_biao_ = parentForm.ri_qi_lie_biao_
+                this.form.lie_biao_shu_ju_ = parentForm.lie_biao_shu_ju_
+                this.form.kai_shi_shi_jian_ = parentForm.kai_shi_shi_jian_
+            }
+            this.formatData()
+        },
+        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
+        }
+    }
+}
+</script>
+
+<style lang="scss">
+.contain{
+    .main{
+        padding: 20px;
+        height: 60vh;
+        .qiyong{
+            margin-top: 0px;
+        }
+        .el-row{
+            margin: 10px 0;
+        }
+        .required{
+            color: #606266 !important;
+            &::before{
+                content: '*';
+                margin: 0 4px 0 -7.5px;
+                color: #F56C6C;
+            }
+        }
+        .eltag{
+            margin-top: 6px;
+        }
+    }
+    .el-row{
+            margin: 0 !important;
+    }
+    .question-icon{
+            margin-left: 2px;
+    }
+}
+.dialog-footer{
+        display: flex;
+        justify-content: center;
+    }
+    ::v-deep {
+        .el-form-item__label{
+        text-align: left
+        }
+    }
+</style>

+ 186 - 0
src/views/system/fasc/index.vue

@@ -0,0 +1,186 @@
+<template>
+    <div class="fasc-card-container">
+        <el-card
+            v-for="card in cardInfos"
+            :key="card.facs_type"
+            :class="isComplete(card.children)?'completed' : 'incomplete'"
+            class="fasc-card"
+        >
+            <div slot="header" class="clearfix fasc-card-hearder" @click="goToDetailPage(card)">
+                <span>{{ card.facs_type.split('-')[1] }}</span>
+            </div>
+
+            <el-collapse v-model="card.activeName" accordion>
+                <el-collapse-item v-for="time in card.children" :key="time.jian_ce_zhou_qi_" :name="time.jian_ce_zhou_qi_">
+                    <template slot="title">
+                        <el-tag size="medium" effect="dark" style="margin-right:10px" :type="isFinish(time.children)?'success':'warning'">{{ time.jian_ce_zhou_qi_ }}</el-tag>
+                        <span style="font-size:16px">{{ todoTitle(time.children) }}</span>
+                    </template>
+                    <div
+                        v-for="item in time.children"
+                        :key="item.name_"
+                        class="card-item"
+                        style="margin-left:20px;"
+                    >
+                        <el-tag size="mini" effect="dark" :type="item.todo===0?'success':'warning'">{{ item.name_ }}</el-tag>
+                        已监测:{{ item.done }},待监测:{{ item.todo }}
+                    </div>
+                </el-collapse-item>
+            </el-collapse>
+
+        </el-card>
+
+    </div>
+</template>
+
+<script>
+import { getFacsDaily } from '@/api/platform/system/jbdHome'
+export default {
+    data () {
+        return {
+            cardInfos: []
+        }
+    },
+    mounted () {
+        getFacsDaily().then(res => {
+            const list = { '每日': 1, '每周': 2, '每月': 3, '每季度': 4, '每半年': 5, '每年': 6 }
+            const data = res.data || []
+            // 先按照 日 周 月 季度 半年 年 排序
+            data.sort((a, b) => {
+                if (list[a.jian_ce_zhou_qi_] && list[b.jian_ce_zhou_qi_]) {
+                    if (a.jian_ce_zhou_qi_ === b.jian_ce_zhou_qi_) {
+                        // 对部门进行排序
+                        return a.name_.localeCompare(b.name_, 'zh') // 'zh' 指定中文排序
+                    } else {
+                        return list[a.jian_ce_zhou_qi_] - list[b.jian_ce_zhou_qi_]
+                    }
+                }
+            })
+            console.log('接口数据', data)
+            const result = []
+            data.forEach(item => {
+                const { facs_type, jian_ce_zhou_qi_, name_, pagePath } = item
+                if (facs_type && jian_ce_zhou_qi_ && name_) {
+                    // 查找现有的分类项
+                    let facsTypeObj = result.find(obj => obj.facs_type === facs_type)
+                    if (!facsTypeObj) {
+                        facsTypeObj = { facs_type, children: [], pagePath }
+                        result.push(facsTypeObj)
+                    }
+                    let jianCeObj = facsTypeObj.children.find(obj => obj.jian_ce_zhou_qi_ === jian_ce_zhou_qi_)
+                    if (!jianCeObj) {
+                        jianCeObj = { jian_ce_zhou_qi_, children: [] }
+                        facsTypeObj.children.push(jianCeObj)
+                    }
+                    const name_Obj = jianCeObj.children.find(obj => obj.name_ === item.name_)
+                    if (!name_Obj) {
+                        jianCeObj.children.push({ ...item })
+                    } else {
+                        name_Obj.done += item.done
+                        name_Obj.todo += item.todo
+                    }
+                }
+            })
+            // 对类型进行排序
+            result.sort((a, b) => {
+                return a.facs_type.localeCompare(b.facs_type, 'zh')
+            })
+            console.log('格式化数据', result)
+            this.cardInfos = result
+        })
+    },
+    methods: {
+        goToDetailPage (card) {
+            if (!card.pagePath) {
+                this.$message.warning('该卡片暂未配置页面路径')
+                return
+            }
+            this.$router.push(card.pagePath)
+        },
+        // 计算已监测总数 和 待监测总数
+        todoTitle (data) {
+            let done = 0
+            let todo = 0
+            data.forEach(item => {
+                done += item.done
+                todo += item.todo
+            })
+            return `已监测:${done},待监测:${todo}`
+        },
+        // 是否已完成
+        isFinish (data) {
+            let todo = 0
+            data.forEach(item => {
+                todo += item.todo
+            })
+            return todo === 0
+        },
+
+        // 所有年份已完成
+        isComplete (data) {
+            let todo = 0
+            data.forEach(item => {
+                item.children.forEach(i => {
+                    todo += i.todo
+                })
+            })
+            return todo === 0
+        }
+    }
+}
+</script>
+<style lang="scss" scoped>
+    .fasc-card-container {
+        display: flex;
+        flex-wrap: wrap;
+        justify-content: flex-start;
+        max-height: calc(100vh - 90px);
+        overflow: auto;
+        .fasc-card-hearder{
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            .el-button{
+                padding: 2px 10px;
+            }
+        }
+        .fasc-card {
+            width: 300px;
+            margin: 20px;
+            transition: all 0.3s ease;
+            cursor: pointer;
+            &:hover {
+                transform: scale(1.05);
+                box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
+            }
+            ::v-deep {
+                .el-card__header {
+                    padding: 16px 20px;
+                    font-weight: bold;
+                }
+                .el-card__body {
+                    padding: 16px;
+                }
+            }
+            .card-item {
+                margin-bottom: 8px;
+            }
+        }
+        .incomplete {
+            // box-shadow: 0 2px 12px 0 rgba(230, 162, 60, .1);
+            ::v-deep {
+                .el-card__header {
+                    background: #E6A23C;
+                }
+            }
+        }
+        .completed {
+            // box-shadow: 0 2px 12px 0 rgba(103, 194, 58, .1);
+            ::v-deep {
+                .el-card__header {
+                    background: #67C23A;
+                }
+            }
+        }
+    }
+  </style>