Przeglądaj źródła

Merge branch '17025' of http://119.23.210.103:3000/wy/lh_firm_former into 17025

wy 1 rok temu
rodzic
commit
23f2ec8de8

+ 1 - 1
src/business/platform/bpmn/components/approval-opinion/index.vue

@@ -148,7 +148,7 @@ export default {
         },
         unCompleteOpinion: {
             type: String,
-            default: '同意'
+            default: '退回修改'
         }
     },
     inject: {

+ 643 - 0
src/views/component/device/maintenanceStatic.vue

@@ -0,0 +1,643 @@
+<template>
+    <el-dialog
+        v-loading="loading"
+        :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="left" :style="{width:initWidth}">
+                <div class="search">
+                    <div class="item">
+                        <div class="label">维护月份:</div>
+                        <div class="content">
+                            <el-date-picker
+                                v-model="month"
+                                :clearable="false"
+                                type="month"
+                                placeholder="选择查询的月份"
+                                value-format="yyyy-MM"
+                                :picker-options="pickerOptions"
+                                size="mini"
+                                @change="handleMonthChange"
+                            />
+                        </div>
+                    </div>
+                </div>
+                <div class="agend">
+                    <div class="descript">
+                        <div class="item">
+                            <div class="green-circle" />
+                            <span>全部完成</span>
+                        </div>
+                        <div class="item">
+                            <div class="orange-circle" />
+                            <span>部分完成</span>
+                        </div>
+                        <div class="item">
+                            <div class="red-circle" />
+                            <span>全部未完成</span>
+                        </div>
+                        <div class="item">
+                            <div class="grey-bg" />
+                            <span>设备未使用</span>
+                        </div>
+                        <div class="item">
+                            <div class="red-bg" />
+                            <span>设备异常</span>
+                        </div>
+                        <div class="item" style="margin-left:60px">
+                            <span>设备异常次数:{{ formatData.repairCount }}</span>
+                        </div>
+                        <div class="item">
+                            <span>设备总维护次数:{{ formatData.maintenanceCount }}</span>
+                        </div>
+                        <div class="item">
+                            <span>设备故障率:{{ formatData.faultRate }} %</span>
+                            <el-tooltip
+                                effect="dark"
+                                content="设备故障率计算公式:异常次数/总维护次数*100%,待处理与未使用不计入总维护次数中。"
+                                placement="top"
+                            >
+                                <i class="el-icon-question question-icon" />
+                            </el-tooltip>
+                        </div>
+                    </div>
+                    <div class="item-time">
+                        <span>统计时间:{{ curTime }}</span>
+                    </div>
+                </div>
+                <div class="table">
+                    <div class="column">
+                        <div class="item">保养类型/日期</div>
+                        <div v-for="item in type" :key="item" class="item">{{ item }}</div>
+                    </div>
+                    <div class="column">
+                        <div v-for="(item,index) in formatData.list" :key="index" class="content-item">
+                            <div class="item">{{ index+1 }}</div>
+                            <div
+                                v-for="(i,ind) in item"
+                                :key="ind"
+                                class="item"
+                                :class="{
+                                    unusual: i.status === false, // 异常
+                                    unused: i.isUsed === false // 未使用
+                                }"
+                            >
+                                <el-tooltip v-show="i.count>0" class="item" effect="light" placement="top-start">
+                                    <template slot="content">
+                                        <div>
+                                            <span v-if="i.todo">待处理:{{ i.todo }};</span>
+                                            <span v-if="i.done">已完成:{{ i.done }};</span>
+                                            <div v-for="(ii,indd) in i.data" :key="indd" class="detail">
+                                                <el-divider />
+                                                <div class="detail-item">
+                                                    <div class="item" style="margin:2px 0">处理人:{{ switchIdToUserName(ii.bian_zhi_ren_)|| '/' }}</div>
+                                                    <div class="item" style="margin:2px 0">设备状态:{{ ii.wei_hu_zhuang_tai|| '/' }}</div>
+                                                    <div class="item" style="margin:2px 0">维护项目:{{ ii.wei_hu_xiang_mu_c|| '/' }}</div>
+                                                    <div class="item" style="margin:2px 0">备注:{{ ii.bei_zhu_|| '/' }}</div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </template>
+                                    <div v-if="i.todo === 0 && i.isUsed" class="green-circle" />
+                                    <div v-if="i.done === 0 && i.todo !== 0" class="red-circle" />
+                                    <div v-if="i.todo !== 0 && i.done !== 0" class="orange-circle" />
+                                </el-tooltip>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </el-dialog>
+</template>
+
+<script>
+import xlsx from 'xlsx'
+import fs from 'file-saver'
+import dayjs from 'dayjs'
+import ibpsUserSelector from '@/business/platform/org/selector'
+export default {
+    components: {
+        ibpsUserSelector
+    },
+    props: {
+        params: {
+            type: Object,
+            default: function () {
+                return {}
+            }
+        },
+        dialogVisible: {
+            type: Boolean,
+            default: false
+        }
+    },
+    data () {
+        const monthList = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
+        const monthValue = dayjs().format('YYYY-MM')
+        const year = +monthValue.split('-')[0]
+        const month = +monthValue.split('-')[1]
+        const monthDays = monthList[month - 1]
+        if ((year % 4 === 0 && year % 100 !== 0) || (year % 400 === 0)) {
+            monthList[1] = 29
+        }
+        const { userId, position, level } = this.$store.getters
+        return {
+            curTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
+            pickerOptions: {
+                disabledDate (time) {
+                    return time.getTime() > Date.now()
+                }
+            },
+            monthList: monthList,
+            month: monthValue,
+            monthDays: monthDays,
+            userId: userId,
+            position: position,
+            level: level.second || level.first,
+            loading: false,
+            title: '设备维护统计',
+            toolbars: [
+                { key: 'export', label: '导出', type: 'primary', hidden: true },
+                { key: 'cancel', label: '返回', type: 'danger' }
+            ],
+            initWidth: '1800px',
+            isEdit: false,
+            isFinished: false,
+            readonly: false,
+            preParams: {},
+            Ids: [],
+            form: {
+            },
+            rules: {
+
+            },
+            dataList: [],
+            type: ['日保养', '周保养', '月保养', '季度保养', '半年保养', '年保养', '按需保养', '间隔保养']
+        }
+    },
+    computed: {
+        deviceColumns () {
+            return {
+                'leiXing': '保养类型',
+                'One': this.month + '-01',
+                'Two': this.month + '-02',
+                'Three': this.month + '-03',
+                'Four': this.month + '-04',
+                'Five': this.month + '-05',
+                'Six': this.month + '-06',
+                'Seven': this.month + '-07',
+                'Eight': this.month + '-08',
+                'Nine': this.month + '-09',
+                'Ten': this.month + '-10',
+                'Eleven': this.month + '-11',
+                'Twelve': this.month + '-12',
+                'Thirteen': this.month + '-13',
+                'Fourteen': this.month + '-14',
+                'Fifteen': this.month + '-15',
+                'Sixteen': this.month + '-16',
+                'Seventeen': this.month + '-17',
+                'Eighteen': this.month + '-18',
+                'Nineteen': this.month + '-19',
+                'Twenty': this.month + '-20',
+                'Twenty-One': this.month + '-21',
+                'Twenty-Two': this.month + '-22',
+                'Twenty-Three': this.month + '-23',
+                'Twenty-Four': this.month + '-24',
+                'Twenty-Five': this.month + '-25',
+                'Twenty-Six': this.month + '-26',
+                'Twenty-Seven': this.month + '-27',
+                'Twenty-Eight': this.month + '-28',
+                'Twenty-Nine': this.month + '-29',
+                'Thirty': this.month + '-30',
+                'Thirty-One': this.month + '-31'
+            }
+        },
+        formatData () {
+            let repairCount = 0 // 异常
+            let maintenanceCount = 0 // 维护
+            const fliterData = this.dataList
+            const result = []
+            fliterData.forEach(item => {
+                const { wei_hu_lei_xing_ } = item
+                const t = result.find(i => i.wei_hu_lei_xing_ === wei_hu_lei_xing_)
+                if (t) {
+                    t.children.push(item)
+                } else {
+                    result.push({
+                        wei_hu_lei_xing_: wei_hu_lei_xing_,
+                        children: [item]
+                    })
+                }
+            })
+            // console.log('fliterData', result)
+            const answer = new Array(this.monthDays)
+            for (let i = 0; i < this.monthDays; i++) {
+                const arr = []
+                const day = ('0' + (i + 1)).slice(-2)
+                const fullDay = this.month + '-' + day
+                // console.log(fullDay)
+                this.type.forEach(item => {
+                    const obj = {
+                        data: [],
+                        count: 0,
+                        todo: 0,
+                        done: 0,
+                        status: true,
+                        isUsed: true
+                    }
+                    const t = result.find(j => j.wei_hu_lei_xing_ === item)
+                    if (t) {
+                        const tempList = t.children.filter(k => k.ji_hua_shi_jian_ === fullDay)
+                        obj.count = tempList.length
+                        obj.todo = tempList.filter(k => k.shi_fou_guo_shen_ === '待处理').length
+                        const yiwancheng = tempList.filter(k => k.shi_fou_guo_shen_ === '已完成')
+                        obj.done = yiwancheng.length
+                        obj.data = yiwancheng
+                        const weixiu = tempList.filter(item => item.wei_hu_zhuang_tai === '异常')
+                        obj.isUsed = !tempList.some(item => item.wei_hu_zhuang_tai === '未使用')
+                        obj.status = weixiu.length === 0
+                        repairCount += weixiu.length
+                        maintenanceCount += yiwancheng.filter(item => item.wei_hu_zhuang_tai !== '未使用').length
+                    }
+                    arr.push(obj)
+                })
+                answer[i] = arr
+            }
+            // 故障率
+            const faultRate = maintenanceCount === 0 ? '0.00' : ((repairCount / maintenanceCount) * 100).toFixed(2)
+            // console.log('data', answer)
+            return { list: answer, repairCount, maintenanceCount, faultRate }
+        }
+    },
+    mounted () {
+        if (this.params.searchMonth) {
+            this.month = this.params.searchMonth
+            this.handleMonthChange(this.month)
+        } else {
+            this.init()
+        }
+    },
+    methods: {
+        handleActionEvent ({ key }) {
+            switch (key) {
+                case 'cancel':
+                    this.closeDialog()
+                    break
+                case 'export':
+                    this.handleExport()
+                    break
+                default:
+                    break
+            }
+        },
+        // 人员id 转人员名称
+        switchIdToUserName (id) {
+            const { userList } = this.$store.getters
+            const temp = userList.find(item => item.userId === id)
+            return temp ? temp.userName : ''
+        },
+        xlsx (json, fields, filename = '.xlsx') { // 导出xlsx
+            json.forEach(item => {
+                for (const i in item) {
+                    if (fields.hasOwnProperty(i)) {
+                        item[fields[i]] = item[i]
+                    }
+                    delete item[i] // 删除原先的对象属性
+                }
+            })
+            const sheetName = filename // excel的文件名称
+            const wb = xlsx.utils.book_new() // 工作簿对象包含一SheetNames数组,以及一个表对象映射表名称到表对象。XLSX.utils.book_new实用函数创建一个新的工作簿对象。
+            const ws = xlsx.utils.json_to_sheet(json, { header: Object.values(fields) }) // 将JS对象数组转换为工作表。
+            wb.SheetNames.push(sheetName)
+            wb.Sheets[sheetName] = ws
+            // console.log('json', ws)
+            const defaultCellStyle = { font: { name: 'Verdana', sz: 13, color: 'FF00FF88' }, fill: { fgColor: { rgb: 'FFFFAA00' }}}// 设置表格的样式
+            const wopts = { bookType: 'xlsx', bookSST: false, type: 'binary', cellStyles: true, defaultCellStyle: defaultCellStyle, showGridLines: false } // 写入的样式
+            const wbout = xlsx.write(wb, wopts)
+            const blob = new Blob([this.s2ab(wbout)], { type: 'application/octet-stream' })
+            fs.saveAs(blob, filename + '.xlsx')
+        },
+        s2ab (s) {
+            let buf
+            if (typeof ArrayBuffer !== 'undefined') {
+                buf = new ArrayBuffer(s.length)
+                const view = new Uint8Array(buf)
+                for (let i = 0; i !== s.length; ++i) view[i] = s.charCodeAt(i) & 0xff
+                return buf
+            } else {
+                buf = new Array(s.length)
+                for (let i = 0; i !== s.length; ++i) buf[i] = s.charCodeAt(i) & 0xFF
+                return buf
+            }
+        },
+        getTimeStamp () {
+            return dayjs().format('YYYYMMDDHHmmss')
+        },
+        handleExport () {
+            const exportData = this.type.map((item, index) => {
+                const obj = { 'leiXing': item }
+                for (let i = 1; i < this.monthDays + 1; i++) {
+                    const t = this.formatData.list[i - 1][index]
+                    const text = `已完成:${t.done};待处理:${t.todo}`
+                    obj[Object.keys(this.deviceColumns)[i]] = text
+                }
+                return obj
+            })
+
+            // const copyData = JSON.parse(JSON.stringify(exportData))
+            // console.log('导出数据', copyData)
+            this.xlsx(exportData, this.deviceColumns, '设备维护统计' + this.getTimeStamp())
+            this.$message.success('导出设备成功!')
+        },
+        async handleMonthChange (val) {
+            const year = +val.split('-')[0]
+            const month = +val.split('-')[1]
+            this.monthDays = this.monthList[month - 1]
+            if ((year % 4 === 0 && year % 100 !== 0) || (year % 400 === 0)) {
+                this.monthList[1] = 29
+            } else {
+                this.monthList[1] = 28
+            }
+            await this.init()
+        },
+        // 获取人员部门
+        getPersonPosition (id) {
+            const userList = this.$store.getters.userList
+            const bianzhiUserid = userList.find(i => i.userId === id)
+            if (bianzhiUserid) {
+                return bianzhiUserid.positionId
+            }
+        },
+        checkRequired (flag) {
+        },
+        // 刷新
+        async goRefresh () {
+        },
+        // 关闭当前窗口
+        closeDialog (needRefresh) {
+            this.$emit('update:dialogVisible', false, needRefresh)
+        },
+        async init () {
+            this.loading = true
+            this.title = `[${this.params.original_device_n}/${this.params.she_bei_ming_chen}]月度设备维护统计`
+            const y = +this.month.split('-')[0]
+            const m = +this.month.split('-')[1]
+            const sql = `select a.id_ AS mainId,a.shi_fou_guo_shen_,a.bian_zhi_bu_men_,c.wei_hu_xiang_mu_c,a.bian_zhi_ren_,a.she_bei_ming_chen,a.she_bei_bian_hao_,a.ri_qi_,a.original_device_n,a.zhu_zhou_qi_,a.nei_rong_qing_kua,a.ji_hua_shi_jian_,c.she_bei_lei_xing_,c.wei_hu_ri_qi_,c.wei_hu_lei_xing_,c.ri_qi_shu_zi_,d.bei_zhu_,d.wei_hu_zhuang_tai from t_mjsbwhbyjlby a left join t_mjsbwhjhzb b on a.ji_hua_wai_jian_ = b.id_ left join v_device_devicemaintenance c on b.she_bei_bian_hao_ = c.id_ left join t_mjsbwhbyjlzby d on a.id_ = d.parent_id_ where a.ri_qi_='${this.params.ri_qi_}' and a.shi_fou_guo_shen_!='已删除' and YEAR(a.ji_hua_shi_jian_) = ${y} and MONTH(a.ji_hua_shi_jian_) = ${m}`
+            const { variables: { data }} = await this.$common.request('sql', sql)
+            this.dataList = data
+            this.dataList.forEach(item => {
+                if (!Object.hasOwn(item, 'wei_hu_lei_xing_') || !item.wei_hu_lei_xing_) {
+                    item.wei_hu_lei_xing_ = '按需保养'
+                }
+            })
+            this.loading = false
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.paper-detail-dialog {
+    ::v-deep {
+        .el-dialog__header {
+            text-align: center;
+        }
+    }
+.dialog-title{
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    div{
+        z-index: 99999999;
+        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;
+            }
+        }
+        .left{
+            height: calc(100vh - 100px);
+            box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+            padding:20px;
+            overflow-y: auto;
+            .agend{
+                margin: 20px 0 10px 0;
+                display: flex;
+                justify-content: space-between;
+                .descript{
+                    display: flex;
+                    gap: 18px;
+                    .item{
+                        width: auto;
+                        display: flex;
+                        align-items: center;
+                        gap: 4px;
+                        .green-circle {
+                            width: 12px;
+                            height: 12px;
+                            background-color: #67C23A;
+                            border-radius: 50%;
+                        }
+                        .red-circle {
+                            width: 12px;
+                            height: 12px;
+                            background-color: #F56C6C;
+                            border-radius: 50%;
+                        }
+                        .orange-circle {
+                            width: 12px;
+                            height: 12px;
+                            background-color: #E6A23C;
+                            border-radius: 50%;
+                        }
+                        .red-bg {
+                            width: 12px;
+                            height: 12px;
+                            background-color: #F56C6C;
+                            opacity: .7;
+                        }
+                        .grey-bg{
+                            width: 12px;
+                            height: 12px;
+                            background-color: #a6b1bd;
+                            opacity: .7;
+                        }
+                    }
+                }
+
+            }
+            .search{
+                .label{
+                    font-size: 12px;
+                }
+                .item{
+                    display: flex;
+                    align-items: center;
+                }
+            }
+            .item{
+                width: 100%;
+            }
+            .title{
+                margin: 16px 0 6px -16px;
+            }
+            .table{
+                display: flex;
+                .column{
+                    flex: 1;
+                    &:nth-child(2){
+                        display: flex;
+                    }
+                    >.item{
+                        height: 50px;
+                        text-align: center;
+                        line-height: 50px;
+                        border-bottom: 1px solid #333;
+                        border-right: 1px solid #333;
+                        border-left: 1px solid #333;
+                        min-width: 100px;
+                    }
+                    @media screen and (max-width: 1800px) {
+                         >.item{
+                            height: 44px;
+                            line-height: 44px;
+                        }
+                    }
+                    @media screen and (max-width: 1550px) {
+                         >.item{
+                            height: 40px;
+                            line-height: 40px;
+                        }
+                    }
+                    >.item:nth-child(1){
+                        font-weight: 600;
+                        border-top: 1px solid #333;
+                        height: 30px;
+                        line-height: 30px;
+                    }
+                    .content-item{
+                        .unusual{
+                            background-color: #F56C6C !important;
+                            opacity: .7 !important;
+                        }
+                        .unused{
+                             background-color: #a6b1bd;
+                             opacity: .7;
+                        }
+                        >.item{
+                            position: relative;
+                            height: 50px;
+                            width: 50px;
+                            text-align: center;
+                            line-height: 50px;
+                            border-bottom: 1px solid #333;
+                            border-right: 1px solid #333;
+                        }
+                        @media screen and (max-width: 1800px) {
+                            >.item{
+                                height: 44px;
+                                width: 44px;
+                                line-height: 44px;
+
+                            }
+                        }
+                        @media screen and (max-width: 1550px) {
+                            >.item{
+                                height: 40px;
+                                width: 40px;
+                                line-height: 40px;
+
+                            }
+                        }
+                        >.item:nth-child(1){
+                            font-weight: 600;
+                            border-top: 1px solid #333;
+                            height: 30px;
+                            line-height: 30px;
+                        }
+                        .green-circle {
+                            cursor: pointer;
+                            position: absolute;
+                            top: 50%;
+                            left: 50%;
+                            transform: translate(-50%, -50%);
+                            width: 10px;
+                            height: 10px;
+                            background-color: #67C23A;
+                            border-radius: 50%;
+                        }
+                        .red-circle {
+                            cursor: pointer;
+                            position: absolute;
+                            top: 50%;
+                            left: 50%;
+                            transform: translate(-50%, -50%);
+                            width: 10px;
+                            height: 10px;
+                            background-color: #F56C6C;
+                            border-radius: 50%;
+                        }
+                        .orange-circle {
+                            cursor: pointer;
+                            position: absolute;
+                            top: 50%;
+                            left: 50%;
+                            transform: translate(-50%, -50%);
+                            width: 10px;
+                            height: 10px;
+                            background-color: #E6A23C;
+                            border-radius: 50%;
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+    ::v-deep {
+        .el-form-item__label{
+            text-align: left;
+            font-size: 12px !important;
+        }
+        .el-form-item__content{
+            font-size: 12px !important;
+        }
+        .el-divider--horizontal{
+            margin: 10px 0;
+        }
+    }
+</style>

+ 205 - 99
src/views/component/device/maintenanceStaticAll.vue

@@ -35,54 +35,94 @@
                             />
                         </div>
                     </div>
-                </div>
-                <div class="agend">
-                    <div class="descript">
-                        <div class="item">
-                            <div class="green-circle" />
-                            <span>全部完成</span>
-                        </div>
-                        <div class="item">
-                            <div class="orange-circle" />
-                            <span>部分完成</span>
-                        </div>
-                        <div class="item">
-                            <div class="red-circle" />
-                            <span>全部未完成</span>
-                        </div>
-                        <div class="item">
-                            <div class="grey-bg" />
-                            <span>设备未使用</span>
-                        </div>
-                        <div class="item">
-                            <div class="red-bg" />
-                            <span>设备异常</span>
+                    <div class="item">
+                        <div class="label">部门:</div>
+                        <ibps-user-selector
+                            v-model="position"
+                            type="org"
+                            readonly-text="text"
+                            :disabled="false"
+                            :multiple="false"
+                            :filter="filter"
+                            filtrate
+                        />
+                    </div>
+                    <div class="item">
+                        <div class="label">设备类型:</div>
+                        <el-select v-model="deviceType" placeholder="请选择" size="mini" :clearable="true">
+                            <el-option
+                                v-for="item in ['检验系统','通用设备']"
+                                :key="item"
+                                :label="item"
+                                :value="item"
+                            />
+                        </el-select>
+                    </div>
+                    <div class="item">
+                        <div class="label">设备编号:</div>
+                        <div class="content">
+                            <el-input v-model="deviceNo" size="mini" />
                         </div>
-                        <div class="item" style="margin-left:60px">
-                            <span>设备异常次数:{{ formatData.repairCount }}</span>
+                    </div>
+                    <div class="item">
+                        <div class="label">设备名称:</div>
+                        <div class="content">
+                            <el-input v-model="deviceName" size="mini" />
                         </div>
-                        <div class="item">
-                            <span>设备总维护次数:{{ formatData.maintenanceCount }}</span>
+                    </div>
+                </div>
+                <div class="hearder">
+                    <div class="agend">
+                        <div class="descript">
+                            <div class="item">
+                                <div class="green-circle" />
+                                <span>全部完成</span>
+                            </div>
+                            <div class="item">
+                                <div class="orange-circle" />
+                                <span>部分完成</span>
+                            </div>
+                            <div class="item">
+                                <div class="red-circle" />
+                                <span>全部未完成</span>
+                            </div>
+                            <div class="item">
+                                <div class="grey-bg" />
+                                <span>设备未使用</span>
+                            </div>
+                            <div class="item">
+                                <div class="red-bg" />
+                                <span>设备异常</span>
+                            </div>
+                            <div class="item" style="margin-left:60px">
+                                <span>设备异常次数:{{ formatData.repairCount }}</span>
+                            </div>
+                            <div class="item">
+                                <span>设备总维护次数:{{ formatData.maintenanceCount }}</span>
+                            </div>
+                            <div class="item">
+                                <span>设备故障率:{{ formatData.faultRate }} %</span>
+                                <el-tooltip
+                                    effect="dark"
+                                    content="设备故障率计算公式:异常次数/总维护次数*100%,待处理与未使用不计入总维护次数中。"
+                                    placement="top"
+                                >
+                                    <i class="el-icon-question question-icon" />
+                                </el-tooltip>
+                            </div>
                         </div>
-                        <div class="item">
-                            <span>设备故障率:{{ formatData.faultRate }} %</span>
-                            <el-tooltip
-                                effect="dark"
-                                content="设备故障率计算公式:异常次数/总维护次数*100%,待处理与未使用不计入总维护次数中。"
-                                placement="top"
-                            >
-                                <i class="el-icon-question question-icon" />
-                            </el-tooltip>
+                        <div class="item-time">
+                            <span>统计时间:{{ curTime }}</span>
                         </div>
                     </div>
-                    <div class="item-time">
-                        <span>统计时间:{{ curTime }}</span>
-                    </div>
                 </div>
-                <div class="table">
+
+                <div v-if="fliterData.length>0" class="table">
                     <div class="column">
-                        <div class="item">保养类型/日期</div>
-                        <div v-for="item in type" :key="item" class="item">{{ item }}</div>
+                        <div class="item">设备名称/日期</div>
+                        <div v-for="(item) in fliterData" :key="item.original_device_n" class="item" style="cursor:pointer" @click="goLookStatic(item)">
+                            <span style="padding:0 6px" :title="item.she_bei_ming_chen">{{ item.original_device_n }}/{{ item.she_bei_ming_chen }}</span>
+                        </div>
                     </div>
                     <div class="column">
                         <div v-for="(item,index) in formatData.list" :key="index" class="content-item">
@@ -105,7 +145,7 @@
                                                 <el-divider />
                                                 <div class="detail-item">
                                                     <div class="item" style="margin:2px 0">处理人:{{ switchIdToUserName(ii.bian_zhi_ren_)|| '/' }}</div>
-                                                    <div class="item" style="margin:2px 0">设备状:{{ ii.wei_hu_zhuang_tai|| '/' }}</div>
+                                                    <div class="item" style="margin:2px 0">设备状:{{ ii.wei_hu_zhuang_tai|| '/' }}</div>
                                                     <div class="item" style="margin:2px 0">维护项目:{{ ii.wei_hu_xiang_mu_c|| '/' }}</div>
                                                     <div class="item" style="margin:2px 0">备注:{{ ii.bei_zhu_|| '/' }}</div>
                                                 </div>
@@ -120,19 +160,23 @@
                         </div>
                     </div>
                 </div>
+                <el-empty v-else description="暂无数据" />
             </div>
+            <MaintenanceStatic v-if="MaintenanceStaticVisible" :dialog-visible.sync="MaintenanceStaticVisible" :params="dialogParams" />
+
         </div>
     </el-dialog>
 </template>
 
 <script>
+import MaintenanceStatic from './maintenanceStatic.vue'
 import xlsx from 'xlsx'
 import fs from 'file-saver'
 import dayjs from 'dayjs'
 import ibpsUserSelector from '@/business/platform/org/selector'
 export default {
     components: {
-        ibpsUserSelector
+        ibpsUserSelector, MaintenanceStatic
     },
     props: {
         params: {
@@ -155,25 +199,33 @@ export default {
         if ((year % 4 === 0 && year % 100 !== 0) || (year % 400 === 0)) {
             monthList[1] = 29
         }
-        const { userId, position, level } = this.$store.getters
+        const { userId, position, level, org } = this.$store.getters
         return {
-            curTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
+            faultRate: 0,
+            maintenanceCount: 0,
+            repairCount: 0,
+            dialogParams: {},
+            MaintenanceStaticVisible: false,
             pickerOptions: {
                 disabledDate (time) {
                     return time.getTime() > Date.now()
                 }
             },
+            curTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
+            deviceNo: '',
+            deviceName: '',
+            deviceType: '',
             monthList: monthList,
             month: monthValue,
             monthDays: monthDays,
             userId: userId,
-            position: position,
+            position: org && org.id || '',
             level: level.second || level.first,
             loading: false,
             title: '设备维护统计',
             toolbars: [
                 { key: 'export', label: '导出', type: 'primary', hidden: true },
-                { key: 'cancel', label: '返回', type: 'danger' }
+                { key: 'cancel', label: '退出', type: 'danger' }
             ],
             initWidth: '1800px',
             isEdit: false,
@@ -187,7 +239,17 @@ export default {
 
             },
             dataList: [],
-            type: ['日保养', '周保养', '月保养', '季度保养', '半年保养', '年保养', '按需保养', '间隔保养']
+            type: ['日保养', '周保养', '月保养', '季度保养', '半年保养', '年保养', '按需保养'],
+            filter: [{
+                descVal: '1',
+                includeSub: true,
+                old: 'position',
+                partyId: this.$store.getters.userInfo.employee.positions,
+                partyName: '',
+                scriptContent: '',
+                type: 'user',
+                userType: 'position'
+            }]
         }
     },
     computed: {
@@ -227,31 +289,49 @@ export default {
                 'Thirty-One': this.month + '-31'
             }
         },
-        formatData () {
-            let repairCount = 0 // 异常
-            let maintenanceCount = 0 // 维护
-            const fliterData = this.dataList
+        fliterData () {
+            let fliterData = this.dataList
+            if (this.position) {
+                fliterData = fliterData.filter(item => item.bian_zhi_bu_men_ === this.position)
+            }
+            if (this.deviceNo) {
+                fliterData = fliterData.filter(item => item.original_device_n?.indexOf(this.deviceNo) > -1)
+            }
+            if (this.deviceType) {
+                fliterData = fliterData.filter(item => item.she_bei_lei_xing_ === this.deviceType)
+            }
+            if (this.deviceName) {
+                fliterData = fliterData.filter(item => item.she_bei_ming_chen?.indexOf(this.deviceName) > -1)
+            }
             const result = []
             fliterData.forEach(item => {
-                const { wei_hu_lei_xing_ } = item
-                const t = result.find(i => i.wei_hu_lei_xing_ === wei_hu_lei_xing_)
+                const { ri_qi_, she_bei_ming_chen, original_device_n, she_bei_lei_xing_ } = item
+                const t = result.find(i => i.ri_qi_ === ri_qi_)
                 if (t) {
                     t.children.push(item)
                 } else {
                     result.push({
-                        wei_hu_lei_xing_: wei_hu_lei_xing_,
+                        she_bei_ming_chen: she_bei_ming_chen,
+                        ri_qi_: ri_qi_,
+                        original_device_n,
+                        she_bei_lei_xing_,
                         children: [item]
                     })
                 }
             })
             // console.log('fliterData', result)
+            return result
+        },
+        formatData () {
+            let repairCount = 0 // 异常
+            let maintenanceCount = 0 // 维护
             const answer = new Array(this.monthDays)
             for (let i = 0; i < this.monthDays; i++) {
                 const arr = []
                 const day = ('0' + (i + 1)).slice(-2)
                 const fullDay = this.month + '-' + day
                 // console.log(fullDay)
-                this.type.forEach(item => {
+                this.fliterData.forEach(item => {
                     const obj = {
                         data: [],
                         count: 0,
@@ -260,20 +340,17 @@ export default {
                         status: true,
                         isUsed: true
                     }
-                    const t = result.find(j => j.wei_hu_lei_xing_ === item)
-                    if (t) {
-                        const tempList = t.children.filter(k => k.ji_hua_shi_jian_ === fullDay)
-                        obj.count = tempList.length
-                        obj.todo = tempList.filter(k => k.shi_fou_guo_shen_ === '待处理').length
-                        const yiwancheng = tempList.filter(k => k.shi_fou_guo_shen_ === '已完成')
-                        obj.done = yiwancheng.length
-                        obj.data = yiwancheng
-                        const weixiu = tempList.filter(item => item.wei_hu_zhuang_tai === '异常')
-                        obj.isUsed = !tempList.some(item => item.wei_hu_zhuang_tai === '未使用')
-                        obj.status = weixiu.length === 0
-                        repairCount += weixiu.length
-                        maintenanceCount += yiwancheng.filter(item => item.wei_hu_zhuang_tai !== '未使用').length
-                    }
+                    const tempList = item.children.filter(k => k.ji_hua_shi_jian_ === fullDay)
+                    obj.count = tempList.length
+                    obj.todo = tempList.filter(k => k.shi_fou_guo_shen_ === '待处理').length
+                    const yiwancheng = tempList.filter(k => k.shi_fou_guo_shen_ === '已完成')
+                    obj.done = yiwancheng.length
+                    obj.data = yiwancheng
+                    const weixiu = obj.data.filter(item => item.wei_hu_zhuang_tai === '异常')
+                    obj.isUsed = !obj.data.some(item => item.wei_hu_zhuang_tai === '未使用')
+                    obj.status = weixiu.length === 0
+                    repairCount += weixiu.length
+                    maintenanceCount += yiwancheng.filter(item => item.wei_hu_zhuang_tai !== '未使用').length
                     arr.push(obj)
                 })
                 answer[i] = arr
@@ -285,12 +362,7 @@ export default {
         }
     },
     mounted () {
-        if (this.params.searchMonth) {
-            this.month = this.params.searchMonth
-            this.handleMonthChange(this.month)
-        } else {
-            this.init()
-        }
+        this.init()
     },
     methods: {
         handleActionEvent ({ key }) {
@@ -305,6 +377,12 @@ export default {
                     break
             }
         },
+        // 查看设备统计
+        goLookStatic (row) {
+            this.dialogParams = row
+            this.dialogParams.searchMonth = this.month
+            this.MaintenanceStaticVisible = true
+        },
         // 人员id 转人员名称
         switchIdToUserName (id) {
             const { userList } = this.$store.getters
@@ -394,11 +472,12 @@ export default {
         },
         async init () {
             this.loading = true
-            this.title = `[${this.params.original_device_n}/${this.params.she_bei_ming_chen}]月度设备维护统计`
+            this.title = `月度设备维护统计`
             const y = +this.month.split('-')[0]
             const m = +this.month.split('-')[1]
-            const sql = `select a.id_ AS mainId,a.shi_fou_guo_shen_,a.bian_zhi_bu_men_,c.wei_hu_xiang_mu_c,a.bian_zhi_ren_,a.she_bei_ming_chen,a.she_bei_bian_hao_,a.ri_qi_,a.original_device_n,a.zhu_zhou_qi_,a.nei_rong_qing_kua,a.ji_hua_shi_jian_,c.she_bei_lei_xing_,c.wei_hu_ri_qi_,c.wei_hu_lei_xing_,c.ri_qi_shu_zi_,d.bei_zhu_,d.wei_hu_zhuang_tai from t_mjsbwhbyjlby a left join t_mjsbwhjhzb b on a.ji_hua_wai_jian_ = b.id_ left join v_device_devicemaintenance c on b.she_bei_bian_hao_ = c.id_ left join t_mjsbwhbyjlzby d on a.id_ = d.parent_id_ where a.ri_qi_='${this.params.ri_qi_}' and a.shi_fou_guo_shen_!='已删除' and YEAR(a.ji_hua_shi_jian_) = ${y} and MONTH(a.ji_hua_shi_jian_) = ${m}`
+            const sql = `select a.id_ AS mainId, a.shi_fou_guo_shen_, a.bian_zhi_bu_men_, c.wei_hu_xiang_mu_c, a.bian_zhi_ren_, a.she_bei_ming_chen, a.she_bei_bian_hao_, a.ri_qi_, a.original_device_n, a.zhu_zhou_qi_, a.nei_rong_qing_kua, a.ji_hua_shi_jian_, c.she_bei_lei_xing_, c.wei_hu_ri_qi_, c.wei_hu_lei_xing_, c.ri_qi_shu_zi_, d.bei_zhu_, d.wei_hu_zhuang_tai FROM t_mjsbwhbyjlby a LEFT JOIN v_device_devicemaintenance c ON a.she_bei_bian_hao_ = c.id_ LEFT JOIN t_mjsbwhbyjlzby d ON a.id_ = d.parent_id_ where a.shi_fou_guo_shen_!='已删除' and YEAR(a.ji_hua_shi_jian_) = ${y} and MONTH(a.ji_hua_shi_jian_) = ${m} `
             const { variables: { data }} = await this.$common.request('sql', sql)
+            // console.log('data', data)
             this.dataList = data
             this.dataList.forEach(item => {
                 if (!Object.hasOwn(item, 'wei_hu_lei_xing_') || !item.wei_hu_lei_xing_) {
@@ -446,7 +525,7 @@ export default {
             &::before{
                 content: '*';
                 margin: 0 4px 0 -7.5px;
-                color: #F56C6C;
+                color: red;
             }
         }
         .left{
@@ -501,12 +580,15 @@ export default {
 
             }
             .search{
-                .label{
-                    font-size: 12px;
-                }
+                display: flex;
                 .item{
+                    width: 300px;
                     display: flex;
                     align-items: center;
+                    .label{
+                        font-size: 12px;
+                        width: 60px;
+                    }
                 }
             }
             .item{
@@ -523,24 +605,35 @@ export default {
                         display: flex;
                     }
                     >.item{
-                        height: 50px;
-                        text-align: center;
-                        line-height: 50px;
+                        height: 46px;
+                        line-height: 46px;
                         border-bottom: 1px solid #333;
                         border-right: 1px solid #333;
                         border-left: 1px solid #333;
-                        min-width: 100px;
+                        span{
+                            display: inline-block;
+                            max-width: 320px;
+                            text-overflow: ellipsis;
+                            white-space: nowrap;
+                            overflow: hidden;
+                        }
                     }
                     @media screen and (max-width: 1800px) {
                          >.item{
-                            height: 44px;
-                            line-height: 44px;
+                            height: 40px;
+                            line-height: 40px;
                         }
                     }
                     @media screen and (max-width: 1550px) {
                          >.item{
-                            height: 40px;
-                            line-height: 40px;
+                            height: 34px;
+                            line-height: 34px;
+                        }
+                    }
+                    @media screen and (max-width: 1450px) {
+                         >.item{
+                            height: 28px;
+                            line-height: 28px;
                         }
                     }
                     >.item:nth-child(1){
@@ -548,6 +641,12 @@ export default {
                         border-top: 1px solid #333;
                         height: 30px;
                         line-height: 30px;
+                        text-align: center;
+                    }
+                    >.item:not(:first-child) {
+                        :hover{
+                            color: #409EFF;
+                        }
                     }
                     .content-item{
                         .unusual{
@@ -560,29 +659,36 @@ export default {
                         }
                         >.item{
                             position: relative;
-                            height: 50px;
-                            width: 50px;
+                            height: 46px;
+                            width: 46px;
                             text-align: center;
-                            line-height: 50px;
+                            line-height: 46px;
                             border-bottom: 1px solid #333;
                             border-right: 1px solid #333;
                         }
                         @media screen and (max-width: 1800px) {
                             >.item{
-                                height: 44px;
-                                width: 44px;
-                                line-height: 44px;
+                                height: 40px;
+                                width: 40px;
+                                line-height: 40px;
 
                             }
                         }
                         @media screen and (max-width: 1550px) {
                             >.item{
-                                height: 40px;
-                                width: 40px;
-                                line-height: 40px;
+                                height: 34px;
+                                width: 34px;
+                                line-height: 34px;
 
                             }
                         }
+                        @media screen and (max-width: 1450px) {
+                         >.item{
+                            height: 28px;
+                            width: 28px;
+                            line-height: 28px;
+                        }
+                        }
                         >.item:nth-child(1){
                             font-weight: 600;
                             border-top: 1px solid #333;

+ 352 - 335
src/views/platform/bpmn/bpmTask/list.vue

@@ -21,10 +21,10 @@
                 <span>{{ scope.column.label }}</span>
                 <el-tooltip class="item" effect="light" placement="bottom">
                     <div slot="content">
-                        此列是查询“流程定义-增加用户设置”的所有用户信息;<br />
-                        当为空的时候,可在‘候选范围’知道原因,如:<br />
-                        设置用户类型为“某组织负责人”且不抽取,在‘用户管理’模块下未配置相关基础数据时,则在审批运行中此列会为空;<br />
-                        此时,可在“候选范围”显示的“某组织负责人”信息快速定位原因!<br />
+                        此列是查询“流程定义-增加用户设置”的所有用户信息;<br>
+                        当为空的时候,可在‘候选范围’知道原因,如:<br>
+                        设置用户类型为“某组织负责人”且不抽取,在‘用户管理’模块下未配置相关基础数据时,则在审批运行中此列会为空;<br>
+                        此时,可在“候选范围”显示的“某组织负责人”信息快速定位原因!<br>
                     </div>
                     <ibps-icon name="help" style="color: #dd5b44" />
                 </el-tooltip>
@@ -52,7 +52,7 @@
             :visible="bpmnFormrenderDialogVisible"
             :task-id="editId"
             :title="flowName"
-            :processName="processName"
+            :process-name="processName"
             @callback="search"
             @close="visible => (bpmnFormrenderDialogVisible = visible)"
         />
@@ -60,368 +60,385 @@
 </template>
 
 <script>
-    import { queryPageList, remove, batchSuspendProcess, batchRecoverProcess, assignee } from '@/api/platform/bpmn/bpmTask'
-    import ActionUtils from '@/utils/action'
-    import FixHeight from '@/mixins/height'
-    import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
-    //import getFormDataFlag from '@/api/platform/form/common.js'
-    import request from '@/utils/request'
-    import { FORM_URL } from '@/api/baseUrl'
-    import { BUSINESS_BASE_URL } from '@/api/baseUrl'
+import { queryPageList, remove, batchSuspendProcess, batchRecoverProcess, assignee } from '@/api/platform/bpmn/bpmTask'
+import ActionUtils from '@/utils/action'
+import FixHeight from '@/mixins/height'
+import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
+// import getFormDataFlag from '@/api/platform/form/common.js'
+import request from '@/utils/request'
+import { FORM_URL } from '@/api/baseUrl'
+import { BUSINESS_BASE_URL } from '@/api/baseUrl'
 
-    export default {
-        components: {
-            'ibps-employee-selector-dialog': () => import('@/business/platform/org/employee/dialog'),
-            'approve-dialog': () => import('@/business/platform/bpmn/form-ext/approve'),
-            'bpmn-formrender': () => import('@/business/platform/bpmn/form/dialog')
-        },
-        mixins: [FixHeight],
-        data() {
-            return {
-                dialogFormVisible: false, // 弹窗
-                bpmnFormrenderDialogVisible: false, // 表单
-                editId: '', // 编辑dialog需要使用
-                action: 'agree', // 打开弹窗的动作
-                pkKey: 'id', // 主键  如果主键不是pk需要传主键
-                flowName: '',
-                processName: '',
-                selectorVisible: false,
-                ids: '',
-                title: '',
-                loading: true,
-                height: document.clientHeight,
+export default {
+    components: {
+        'ibps-employee-selector-dialog': () => import('@/business/platform/org/employee/dialog'),
+        'approve-dialog': () => import('@/business/platform/bpmn/form-ext/approve'),
+        'bpmn-formrender': () => import('@/business/platform/bpmn/form/dialog')
+    },
+    mixins: [FixHeight],
+    data () {
+        return {
+            dialogFormVisible: false, // 弹窗
+            bpmnFormrenderDialogVisible: false, // 表单
+            editId: '', // 编辑dialog需要使用
+            action: 'agree', // 打开弹窗的动作
+            pkKey: 'id', // 主键  如果主键不是pk需要传主键
+            flowName: '',
+            processName: '',
+            selectorVisible: false,
+            ids: '',
+            title: '',
+            loading: true,
+            height: document.clientHeight,
 
-                listData: [],
-                pagination: {},
-                sorts: {},
-                listConfig: {
-                    toolbars: [
-                        {
-                            key: 'search'
-                        },
+            listData: [],
+            pagination: {},
+            sorts: {},
+            listConfig: {
+                toolbars: [
+                    {
+                        key: 'search'
+                    },
+                    {
+                        key: 'agree',
+                        label: '同意',
+                        icon: 'ibps-icon-check-square-o'
+                    },
+                    {
+                        key: 'stop',
+                        label: '终止',
+                        icon: 'ibps-icon-stop'
+                    },
+                    {
+                        key: 'suspend',
+                        label: '挂起',
+                        icon: 'ibps-icon-ioxhost'
+                    },
+                    {
+                        key: 'recover',
+                        label: '恢复',
+                        icon: 'ibps-icon-ioxhost'
+                    },
+                    {
+                        key: 'assignee',
+                        label: '指定执行人',
+                        icon: 'ibps-icon-cog'
+                    }
+                ],
+                searchForm: {
+                    forms: [
                         {
-                            key: 'agree',
-                            label: '同意',
-                            icon: 'ibps-icon-check-square-o'
+                            prop: 'Q^subject_^SL',
+                            label: '请求标题'
                         },
                         {
-                            key: 'stop',
-                            label: '终止',
-                            icon: 'ibps-icon-stop'
+                            prop: 'Q^proc_def_key_^SL',
+                            label: '业务主键'
                         },
                         {
-                            key: 'suspend',
-                            label: '挂起',
-                            icon: 'ibps-icon-ioxhost'
+                            prop: 'Q^NAME_^SL',
+                            label: '当前节点'
                         },
                         {
-                            key: 'recover',
-                            label: '恢复',
-                            icon: 'ibps-icon-ioxhost'
-                        },
+                            prop: ['Q^CREATE_TIME_^DL', 'Q^CREATE_TIME_^DG'],
+                            label: '创建时间',
+                            fieldType: 'daterange'
+                        }
+                    ]
+                },
+                // 表格字段配置
+                columns: [
+                    {
+                        prop: 'subject',
+                        label: '请求标题',
+                        link: 'dialog'
+                    },
+                    {
+                        prop: 'procDefKey',
+                        label: '业务主键',
+                        width: 120
+                    },
+                    {
+                        prop: 'name',
+                        label: '当前节点',
+                        width: 120
+                    },
+                    {
+                        prop: 'ownerName',
+                        label: '候选人',
+                        width: 150,
+                        headerName: 'headerIcon'
+                    },
+                    {
+                        prop: 'partyTypeName',
+                        label: '候选人范围',
+                        width: 150
+                    },
+                    {
+                        prop: 'createTime',
+                        label: '创建时间',
+                        sortable: 'custom',
+                        width: 150
+                    }
+                ],
+                rowHandle: {
+                    actions: [
                         {
                             key: 'assignee',
                             label: '指定执行人',
                             icon: 'ibps-icon-cog'
-                        }
-                    ],
-                    searchForm: {
-                        forms: [
-                            {
-                                prop: 'Q^subject_^SL',
-                                label: '请求标题'
-                            },
-                            {
-                                prop: 'Q^proc_def_key_^SL',
-                                label: '业务主键'
-                            },
-                            {
-                                prop: 'Q^NAME_^SL',
-                                label: '当前节点'
-                            },
-                            {
-                                prop: ['Q^CREATE_TIME_^DL', 'Q^CREATE_TIME_^DG'],
-                                label: '创建时间',
-                                fieldType: 'daterange'
-                            }
-                        ]
-                    },
-                    // 表格字段配置
-                    columns: [
-                        {
-                            prop: 'subject',
-                            label: '请求标题',
-                            link: 'dialog'
-                        },
-                        {
-                            prop: 'procDefKey',
-                            label: '业务主键',
-                            width: 120
                         },
                         {
-                            prop: 'name',
-                            label: '当前节点',
-                            width: 120
-                        },
-                        {
-                            prop: 'ownerName',
-                            label: '候选人',
-                            width: 150,
-                            headerName: 'headerIcon'
-                        },
-                        {
-                            prop: 'partyTypeName',
-                            label: '候选人范围',
-                            width: 150
-                        },
-                        {
-                            prop: 'createTime',
-                            label: '创建时间',
-                            sortable: 'custom',
-                            width: 150
+                            key: 'approve',
+                            label: '审批',
+                            icon: 'ibps-icon-edit'
                         }
-                    ],
-                    rowHandle: {
-                        actions: [
-                            {
-                                key: 'assignee',
-                                label: '指定执行人',
-                                icon: 'ibps-icon-cog'
-                            },
-                            {
-                                key: 'approve',
-                                label: '审批',
-                                icon: 'ibps-icon-edit'
-                            }
-                        ]
-                    }
+                    ]
                 }
             }
+        }
+    },
+    created () {
+        this.loadData()
+    },
+    methods: {
+        removeDesc (str) {
+            const parts = str.split('#')
+            if (parts.length > 2) {
+                return parts.slice(0, 2).join('#') + '#'
+            } else {
+                return str
+            }
+        },
+        // 加载数据
+        loadData () {
+            this.loading = true
+            queryPageList(this.getSearcFormData()).then(response => {
+                const { dataResult = [] } = response.data || {}
+                dataResult.forEach(i => {
+                    i.subject = this.removeDesc(i.subject)
+                })
+                ActionUtils.handleListData(this, response.data)
+                this.loading = false
+            }).catch(() => {
+                this.loading = false
+            })
         },
-        created() {
+        /**
+         * 获取格式化参数
+         */
+        getSearcFormData () {
+            return ActionUtils.formatParams(
+                this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {},
+                this.pagination,
+                this.sorts
+            )
+        },
+        /**
+         * 处理分页事件
+         */
+        handlePaginationChange (page) {
+            ActionUtils.setPagination(this.pagination, page)
             this.loadData()
         },
-        methods: {
-            // 加载数据
-            loadData() {
-                this.loading = true
-                queryPageList(this.getSearcFormData()).then(response => {
-                    ActionUtils.handleListData(this, response.data)
-                    this.loading = false
-                }).catch(() => {
-                    this.loading = false
-                })
-            },
-            /**
-             * 获取格式化参数
-             */
-            getSearcFormData() {
-                return ActionUtils.formatParams(
-                    this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {},
-                    this.pagination,
-                    this.sorts
-                )
-            },
-            /**
-             * 处理分页事件
-             */
-            handlePaginationChange(page) {
-                ActionUtils.setPagination(this.pagination, page)
-                this.loadData()
-            },
-            /**
-             * 处理排序
-             */
-            handleSortChange(sort) {
-                ActionUtils.setSorts(this.sorts, sort)
-                this.loadData()
-            },
-            /**
-             * 查询
-             */
-            search() {
-                this.loadData()
-            },
-            /**
-             * 处理按钮事件
-             */
-            handleAction(command, position, selection, data) {
-                switch (command) {
-                    case 'search': // 查询
-                        ActionUtils.setFirstPagination(this.pagination)
-                        this.search()
-                        break
-                    case 'stop': // 终止
-                        ActionUtils.selectedMultiRecord(selection).then(ids => {
-                            this.handleBatchApprove(ids, 'stop')
-                            this.title = '批量终止流程'
-                        }).catch(() => {})
-                        break
-                    case 'agree': // 同意
-                        ActionUtils.selectedMultiRecord(selection).then(ids => {
-                            this.handleBatchApprove(ids, 'agree')
-                            this.title = '批量同意审批'
-                        }).catch(() => {})
-                        break
-                    case 'suspend': // 挂起
-                        ActionUtils.selectedMultiRecord(selection).then(ids => {
-                            this.handleSuspend(ids)
-                        }).catch(() => {})
-                        break
-                    case 'recover': // 恢复
-                        ActionUtils.selectedMultiRecord(selection).then(ids => {
-                            this.handleRecover(ids)
-                        }).catch(() => {})
-                        break
-                    case 'assignee': // 指定执行人
-                        ActionUtils.selectedMultiRecord(selection).then(ids => {
-                            this.handleAssignee(ids)
-                        }).catch(() => {})
-                        break
-                    case 'approve': // 审批
-                        ActionUtils.selectedMultiRecord(selection).then(ids => {
-                            this.handleApprove(ids)
-                        }).catch(() => {})
-                        break
-                    default:
-                        break
-                }
-            },
-            /**
-             * 处理审批
-             */
-            handleBatchApprove(id = '', action = 'agree') {
-                this.editId = id
-                this.action = action
-                this.dialogFormVisible = true
-            },
-            /**
-             * 处理删除
-             */
-            handleRemove(ids) {
-                remove({ levelIds: ids }).then(response => {
-                    ActionUtils.removeSuccessMessage()
+        /**
+         * 处理排序
+        */
+        handleSortChange (sort) {
+            ActionUtils.setSorts(this.sorts, sort)
+            this.loadData()
+        },
+        /**
+         * 查询
+         */
+        search () {
+            this.loadData()
+        },
+        /**
+         * 处理按钮事件
+         */
+        handleAction (command, position, selection, data) {
+            switch (command) {
+                case 'search': // 查询
+                    ActionUtils.setFirstPagination(this.pagination)
                     this.search()
-                }).catch(() => {})
-            },
-            /**
-             * 批量挂起任务
-             */
-            handleSuspend(ids) {
-                this.$confirm('确认批量挂起流程任务?', '信息').then(() => {
-                    batchSuspendProcess({ taskIds: ids }).then(() => {
-                        ActionUtils.successMessage('挂起流程任务成功')
-                        this.search()
-                    }).catch(error => {
-                        console.error(error)
-                    })
-                })
-            },
-            /**
-             * 批量挂起任务
-             */
-            handleRecover(ids) {
-                this.$confirm('确认批量恢复流程任务?', '信息').then(() => {
-                    batchRecoverProcess({ taskIds: ids }).then(() => {
-                        ActionUtils.successMessage('恢复流程任务成功')
-                        this.search()
-                    }).catch(error => {
-                        console.error(error)
-                    })
+                    break
+                case 'stop': // 终止
+                    ActionUtils.selectedMultiRecord(selection).then(ids => {
+                        this.handleBatchApprove(ids, 'stop')
+                        this.title = '批量终止流程'
+                    }).catch(() => {})
+                    break
+                case 'agree': // 同意
+                    ActionUtils.selectedMultiRecord(selection).then(ids => {
+                        this.handleBatchApprove(ids, 'agree')
+                        this.title = '批量同意审批'
+                    }).catch(() => {})
+                    break
+                case 'suspend': // 挂起
+                    ActionUtils.selectedMultiRecord(selection).then(ids => {
+                        this.handleSuspend(ids)
+                    }).catch(() => {})
+                    break
+                case 'recover': // 恢复
+                    ActionUtils.selectedMultiRecord(selection).then(ids => {
+                        this.handleRecover(ids)
+                    }).catch(() => {})
+                    break
+                case 'assignee': // 指定执行人
+                    ActionUtils.selectedMultiRecord(selection).then(ids => {
+                        this.handleAssignee(ids)
+                    }).catch(() => {})
+                    break
+                case 'approve': // 审批
+                    ActionUtils.selectedMultiRecord(selection).then(ids => {
+                        this.handleApprove(ids)
+                    }).catch(() => {})
+                    break
+                default:
+                    break
+            }
+        },
+        /**
+         * 处理审批
+         */
+        handleBatchApprove (id = '', action = 'agree') {
+            this.editId = id
+            this.action = action
+            this.dialogFormVisible = true
+        },
+        /**
+         * 处理删除
+         */
+        handleRemove (ids) {
+            remove({ levelIds: ids }).then(response => {
+                ActionUtils.removeSuccessMessage()
+                this.search()
+            }).catch(() => {})
+        },
+        /**
+         * 批量挂起任务
+         */
+        handleSuspend (ids) {
+            this.$confirm('确认批量挂起流程任务?', '信息').then(() => {
+                batchSuspendProcess({ taskIds: ids }).then(() => {
+                    ActionUtils.successMessage('挂起流程任务成功')
+                    this.search()
+                }).catch(error => {
+                    console.error(error)
                 })
-            },
-            /**
-             * 指定执行人
-             */
-            handleAssignee(ids) {
-                this.ids = ids
-                this.selectorVisible = true
-            },
-            handleSelectorActionEvent(buttonKey, data) {
-                switch (buttonKey) {
-                    case 'confirm': // 确定
-                        this.handleConfirm(data)
-                        break
-                }
-            },
-            handleConfirm(data) {
-                assignee({
-                    taskId: this.ids,
-                    userId: data.map(d => { return d.id }).join(',')
-                }).then(response => {
-                    this.selectorVisible = false
-                    ActionUtils.success('指定执行人成功!')
+            })
+        },
+        /**
+         * 批量挂起任务
+         */
+        handleRecover (ids) {
+            this.$confirm('确认批量恢复流程任务?', '信息').then(() => {
+                batchRecoverProcess({ taskIds: ids }).then(() => {
+                    ActionUtils.successMessage('恢复流程任务成功')
                     this.search()
+                }).catch(error => {
+                    console.error(error)
                 })
-            },
-            /**
-             * 审批
-             */
-            handleApprove(id) {
-                // this_.editId = id
-                // this_.bpmnFormrenderDialogVisible = true
-                // return
+            })
+        },
+        /**
+         * 指定执行人
+         */
+        handleAssignee (ids) {
+            this.ids = ids
+            this.selectorVisible = true
+        },
+        handleSelectorActionEvent (buttonKey, data) {
+            switch (buttonKey) {
+                case 'confirm': // 确定
+                    this.handleConfirm(data)
+                    break
+            }
+        },
+        handleConfirm (data) {
+            assignee({
+                taskId: this.ids,
+                userId: data.map(d => { return d.id }).join(',')
+            }).then(response => {
+                this.selectorVisible = false
+                ActionUtils.success('指定执行人成功!')
+                this.search()
+            })
+        },
+        /**
+         * 审批
+         */
+        handleApprove (id) {
+            // this_.editId = id
+            // this_.bpmnFormrenderDialogVisible = true
+            // return
 
-                // getFormDataFlag(JSON.stringify({taskId:id})).then(response => {
-                //     console.log("111")
-                //     if( response.data.data=='Y'){
-                //         this_.editId = id
-                //         this_.bpmnFormrenderDialogVisible = true
-                //     }else{
-                //         ActionUtils.success('任务生成中、请稍后重试...!')
-                //         this_.search()
-                //     }
-                // })
+            // getFormDataFlag(JSON.stringify({taskId:id})).then(response => {
+            //     console.log("111")
+            //     if( response.data.data=='Y'){
+            //         this_.editId = id
+            //         this_.bpmnFormrenderDialogVisible = true
+            //     }else{
+            //         ActionUtils.success('任务生成中、请稍后重试...!')
+            //         this_.search()
+            //     }
+            // })
 
-                // 打开表单前获取flowName和processName,避免流程节点状态bug
-                let selected = this.listData.find(item => item.id === id)
-                this.flowName = selected.name
-                this.processName = this.getProjectName(selected.procDefKey, selected.subject)
+            // 打开表单前获取flowName和processName,避免流程节点状态bug
+            const selected = this.listData.find(item => item.id === id)
+            this.flowName = selected.name
+            this.processName = this.getProcessName(selected.procDefKey, selected.subject)
 
-                request({
-                    url: BUSINESS_BASE_URL() + '/getFormData/flag',
-                    method: 'post',
-                    data: JSON.stringify({ taskId: id })
-                }).then(response => {
-                    if (response.data != 'N') {
-                        this.editId = id
-                        this.bpmnFormrenderDialogVisible = true
-                    } else {
-                        ActionUtils.success('任务生成中、请稍后重试...!')
-                        this.search()
-                    }
-                })
+            request({
+                url: BUSINESS_BASE_URL() + '/getFormData/flag',
+                method: 'post',
+                data: JSON.stringify({ taskId: id })
+            }).then(response => {
+                if (response.data !== 'N') {
+                    this.editId = id
+                    this.bpmnFormrenderDialogVisible = true
+                } else {
+                    ActionUtils.success('任务生成中、请稍后重试...!')
+                    this.search()
+                }
+            })
 
-                // let sql = "select ID_,HOT_READ_ from ibps_bpm_tasks where TASK_ID_='"+id+"'"
-                // curdPost('sql',sql).then(response => {
-                //     if( response.variables.data.length>0){
-                //         if( response.variables.data[0].HOT_READ_=='1'){
-                //             this_.editId = id
-                //             this_.bpmnFormrenderDialogVisible = true
-                //         } else {
-                //             ActionUtils.success('任务生成中、请稍后重试...!')
-                //             this_.search()
-                //         }
-                //     } else {
-                //         ActionUtils.success('任务状态已过期、请刷新页面...!')
-                //         this_.search()
-                //     }
-                // })
-            },
-            handleLinkClick(data, columns) {
-                this.flowName = data.name
-                this.processName = this.getProjectName(data.procDefKey, data.subject)
-                this.handleApprove(data[this.pkKey])
-            },
-            // 判断是否为检测项目流程,是则截取流程标题为表单名称
-            getProjectName(key, subject) {
-                // 从store中获取保存的检测流程信息数组,默认设置已知的四个流程key(三非通用一通用),流程key有变化需修改此处默认值
-                const { testingList = ['Process_0idt26n', 'Process_1rwhy1r', 'Process_05lkhio', 'Process_140upmu'] } = this.$store.getters
-                let res = testingList.includes(key)
-                return res ? subject.includes('#') ? subject.split('#')[0] : '' : ''
+            // let sql = "select ID_,HOT_READ_ from ibps_bpm_tasks where TASK_ID_='"+id+"'"
+            // curdPost('sql',sql).then(response => {
+            //     if( response.variables.data.length>0){
+            //         if( response.variables.data[0].HOT_READ_=='1'){
+            //             this_.editId = id
+            //             this_.bpmnFormrenderDialogVisible = true
+            //         } else {
+            //             ActionUtils.success('任务生成中、请稍后重试...!')
+            //             this_.search()
+            //         }
+            //     } else {
+            //         ActionUtils.success('任务状态已过期、请刷新页面...!')
+            //         this_.search()
+            //     }
+            // })
+        },
+        handleLinkClick (data, columns) {
+            this.flowName = data.name
+            this.processName = this.getProcessName(data.procDefKey, data.subject)
+            this.handleApprove(data[this.pkKey])
+        },
+        // 判断是否特殊流程,是则截取流程标题做为表单名称
+        getProcessName (key, subject) {
+            // 从store中获取特殊流程数组
+            const { specialProcessList = ['Process_16lkr65'] } = this.$store.getters
+            const isSpecial = specialProcessList.includes(key)
+            const arr = subject.split('#')
+            if (!isSpecial || !arr[2]) {
+                return ''
             }
+            const temp = JSON.parse(`{${arr[2]}}`)
+            return temp.hasOwnProperty('formName') ? temp.processName : ''
         }
     }
+}
 </script>
 <style lang="scss">
     // .bpm-task-dialog {

Plik diff jest za duży
+ 597 - 576
src/views/system/dashboard/components/new-home.vue


+ 325 - 235
src/views/system/jbdScan/goods/deviceTag.vue

@@ -1,280 +1,370 @@
 <template>
-  <div class="bg">
-    <el-dialog 
-      width="11cm"
-      height="10cm" 
-       :modal-append-to-body='true' :append-to-body="true" title="设备标签" :visible.sync="scanVisible">
-      <!-- 表单是否显示 -->
-      <div style="height:500px">
-          <div ref="qrcode" id="box">
-          <vue-easy-print tableShow ref="easyPrint"
-            :onePageRow="onePageRow"
-          >
-            <div v-for="(item1, index1) in list" :key="index1"  >
-              <div v-for="(item2, index2) in parseInt(item1.num)" :key="index2" 
-              
-              ><!-- style="page-break-after:always" -->
-               <div class="All">
-                <div class="tagBox">
-                  <div class="lh">
-                    <div>设备名称:</div>
-                    <div>{{ item1.name }}</div>
-                  </div>
-                  <div class="la">
-                    <div class="lh">
-                      <div>设备编号:</div>
-                      <div>{{ item1.serial }}</div>
-                    </div>
-                  </div>
-                  <div class="lh">
-                    <div>规格型号:</div>
-                    <div>{{ item1.specifications }}</div>
-                  </div>
-                  <!-- <div class="lh">
-                    <div>存放地点:</div>
-                    <div>{{ item1.local }}</div>
-                  </div> -->
-                  <div class="lh">
-                    <div>启用日期:</div>
-                    <div>{{ item1.time }}</div>
-                  </div>
-
-                  <div class="lh">
-                    <div>资产原值:</div>
-                    <div>{{ item1.money }}</div>
-                  </div>
-                  <div class="lh">
-                    <div>使用科室:</div>
-                    <div>细胞质量检测实验室</div>
-                    <!-- <div>{{ item1.condition }}</div> -->
-                  </div>
-                  <div class="lh">
-                    <div>固定资产编号:</div>
-                    <div>{{ item1.assets }}</div>
-                  </div>
-
-                 
-                  <!-- <div class="lh">
-                    <div>设备状态:</div>
-                    <div>{{ item1.status }}</div>
-                  </div> -->
-                  <div class="lh">
-                    <div>保管人:</div>
-                    <div>{{ item1.custodian }}</div>
-                  </div>
-                  <div class="ewm">
-                    <vue-barcode :value="item1.serial" :width=1.5 :height=15  :margin="0" :displayValue="false"></vue-barcode>
-                  </div>
-
-                  <!-- <div
-                    style="page-break-after: always; display: block !important;height: 40px"
-                  ></div> -->
-
+    <div class="bg">
+        <el-dialog
+            width="11cm"
+            height="10cm"
+            :modal-append-to-body="true"
+            :append-to-body="true"
+            title="设备标签"
+            :visible.sync="dialogVisible"
+            @close="close"
+        >
+            <!-- 表单是否显示 -->
+            <div style="height:500px">
+                <div id="box" ref="qrcode">
+                    <vue-easy-print ref="easyPrint" table-show :one-page-row="onePageRow">
+                        <div v-for="(item, index) in list" :key="index">
+                            <div class="All">
+                                <div>
+                                    <div class="one">
+                                        <div class="container">
+                                            <div
+                                                :class="item.deviceStatus === '合格' ? 'triangle' : item.deviceStatus === '停用' ? 'triangleRed' : item.deviceStatus === '限用' ? 'triangleYellow': 'triangleGray'"
+                                            >
+                                                <div class="label" style="border: 0;">{{ item.prove }}</div>
+                                            </div>
+                                            <div style="position: absolute;top: 25px;width: 100%;">
+                                                <div
+                                                    style="display: flex;justify-content: space-between;font-size: 14px;font-weight: 800;margin: 0 8px;"
+                                                >
+                                                    <div>{{ item.slogan }}</div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="tagBox">
+                                        <div class="lh">
+                                            <div class="qianZhi">设备名称:</div>
+                                            <div>{{ item.name }}</div>
+                                        </div>
+                                        <div class="lh">
+                                            <div>设备型号:</div>
+                                            <div>{{ item.model }}</div>
+                                        </div>
+                                        <div class="lh">
+                                            <div>设备编号:</div>
+                                            <div>{{ item.serial }}</div>
+                                        </div>
+                                        <div class="lh">
+                                            <div>固定资产号:</div>
+                                            <div>{{ item.assetNum }}</div>
+                                        </div>
+                                        <div class="lh">
+                                            <div>核查人:</div>
+                                            <div>{{ item.verifier }}</div>
+                                        </div>
+                                        <div class="lh" :style="item.range !== '' ? 'border-bottom: 1px solid #000000;' : 'border-bottom: 0px;'">
+                                            <div>核查日期:</div>
+                                            <div>{{ item.verificationDate }}</div>
+                                        </div>
+                                        <!-- <div class="lh">
+                                          <div class="la">
+                                              <div>核查人:</div>
+                                              <div>{{ item.verifier }}</div>
+                                          </div>
+                                          <div class="la" style="border-left: 1px solid #000000;">
+                                              <div>核查日期:</div>
+                                              <div>{{ item.verificationDate }}</div>
+                                          </div>
+                                      </div> -->
+                                        <div v-if="item.range !== ''" class="lh" style="border-bottom: 0px;">
+                                            <div class="qianZhi">限用范围:</div>
+                                            <div class="zuoJuZhong">{{ item.range }}</div>
+                                        </div>
+                                    </div>
+                                </div>
 
+                            </div>
+                        </div>
+                    </vue-easy-print>
                 </div>
-               </div>
-              </div>
             </div>
-          </vue-easy-print>
-        </div>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <!-- <el-button @click="dialogVisible = false">取 消</el-button> -->
-        <el-button type="primary" @click="printDemo">打印标签</el-button>
-      </span>
-    </el-dialog>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="close">取 消</el-button>
+                <el-button type="primary" @click="printDemo">打印标签</el-button>
+            </span>
+        </el-dialog>
 
-
-  </div>
+    </div>
 </template>
 
 <script>
-import VueBarcode from 'vue-barcode';
-import vueEasyPrint from "vue-easy-print";
-import repostCurd from '@/business/platform/form/utils/custom/joinCURD.js';
+import VueBarcode from 'vue-barcode'
+import vueEasyPrint from 'vue-easy-print'
+import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
 
 export default {
-  components: {
-    VueBarcode,
-    vueEasyPrint,
-  },
-  props: {
-    obj: {
-      default: [],
-      type: Array
+    components: {
+        VueBarcode,
+        vueEasyPrint
     },
-    onePageRow:{
-      type:Number,
-      default:3
+    props: {
+        obj: {
+            default: () => [],
+            type: Array
+        },
+        onePageRow: {
+            type: Number,
+            default: 3
+        },
+        blankLines: {
+            type: Boolean,
+            default: true
+        },
+        scanVisible: {
+            type: Boolean,
+            default: false
+        },
+        stateList: {
+            type: Object,
+            default: function () {
+                return { '停用': '停用', '报废': '报废', '合格': '合格' }
+            }
+        }
     },
-    blankLines:{
-      type:Boolean,
-      default:true
+    data () {
+        return {
+            dialogVisible: false,
+            value: '',
+            id: '',
+            list: [{
+                name: '设备名称',
+                serial: '设备编号',
+                model: '型号规格',
+                verifier: '核查人',
+                verificationDate: '核查日期',
+                // status: 1
+                prove: '测试证', // 证名
+                slogan: '标语', // 标语
+                deviceStatus: '设备状态',
+                range: '限用范围', // 限用范围
+                assetNum: '固定资产号'
+            }],
+            visible: true
+        }
     },
-    scanVisible:{
-      type:Boolean,
-      default: false
-    }
-  },
-  data() {
-    return {
-      value: '',
-      id: '',
-      list: [{
-        name: 1,
-        serial: 1,
-        assets: 1,
-        num: 1,
-        local:1,
-        condition: 1,
-        money:1,
-        time:1,
-        status:1,
-        specifications:1,
-        custodian:1
-      }],
-      visible: true,
-    }
-  },
-  watch: {
-    obj() {
-      this.getInit()
-      // console.log(this.obj)
-    }
-  },
-  created() {
-    this.getInit()
-  },
-  methods: {
-    printDemo() {
-      this.$refs.easyPrint.print()
+    watch: {
+        obj () {
+            this.getInit()
+        },
+        scanVisible: {
+            handler (val) {
+                this.dialogVisible = val
+            },
+            immediate: true
+        }
     },
-    getInit() {
-      var idStr = '';
-      this.obj.forEach(item=>{
-        idStr += item.split(" ")[0] + ','
-      })
-      idStr = idStr.substring(0,idStr.length-1);
-      this.getLook(idStr)
+    created () {
+        this.getInit()
     },
-    getLook(id) {
-      let sql = `select * from t_sbdj where find_in_set(id_,'${id}')`
-      let personSql = `select id_,NAME_ from ibps_party_employee`
-      Promise.all([repostCurd("sql", sql),repostCurd("sql", personSql)]).then(([res1,res2])=>{
-        const { data } = res1.variables || []
-        const personData = res2.variables.data || []
-        let list = []
-          data.forEach(item => {
-            let num = 1
-            let o = {
-              name: item.she_bei_ming_cheng_,
-              serial: item.she_bei_shi_bie_h,
-              assets: item.zi_chan_bian_hao_,
-              num: num,
-              local:item.cun_fang_di_dian_,
-              condition: item.shi_yong_ke_shi_,
-              money:item.zi_chan_yuan_zhi_,
-              // time:item.qi_yong_ri_qi_!=null?this.getTime(item.qi_yong_ri_qi_):'',
-              time:item.kai_shi_shi_yong_!=null?this.getTime(item.kai_shi_shi_yong_):'', // 档案卡没放启用日期,改为开始时间
-              status:item.she_bei_zhuang_ta,
-              specifications:item.gui_ge_xing_hao_,
-              custodian: this.findPersonName(item.guan_li_ren_,personData)
+    methods: {
+        close () {
+            this.dialogVisible = false
+            this.$emit('scanOff')
+        },
+        printDemo () {
+            this.$refs.easyPrint.print()
+        },
+        getInit () {
+            var idStr = ''
+            this.obj.forEach(item => {
+                idStr += item.split(' ')[0] + ','
+            })
+            idStr = idStr.substring(0, idStr.length - 1)
+            this.getLook(idStr)
+        },
+        getLook (id) {
+            const sql = `select
+                  dj.she_bei_ming_cheng_,
+                  dj.she_bei_shi_bie_h,
+                  dj.gui_ge_xing_hao_,
+                  dj.she_bei_zhuang_ta,
+                  dj.bi_xu_de_huan_jin,
+                  dj.bi_xu_she_shi_,
+                  dj.cai_gou_he_tong_,
+                  dj.zi_chan_bian_hao_
+              FROM
+                  t_sbdj dj
+              WHERE
+                  find_in_set( dj.id_, '${id}' )`
+            // console.log(sql)
+            const personSql = `select id_,NAME_ from ibps_party_employee`
+            Promise.all([curdPost('sql', sql), curdPost('sql', personSql)]).then(([res1, res2]) => {
+                const { data } = res1.variables || []
+                const personData = res2.variables.data || []
+                console.log(data)
+                // console.log(personData)
+                const list = []
+                data.forEach(item => {
+                    const verificationDateStr = item.bi_xu_she_shi_ ? item.bi_xu_she_shi_ : ''
+                    const o = {
+                        prove: this.switchProve(item.she_bei_zhuang_ta),
+                        slogan: this.switchSlogan(item.she_bei_zhuang_ta),
+                        deviceStatus: item.she_bei_zhuang_ta,
+                        range: this.judgementVal(item.cai_gou_he_tong_) ? item.cai_gou_he_tong_ : '',
+                        assetNum: item.zi_chan_bian_hao_,
+
+                        name: item.she_bei_ming_cheng_,
+                        serial: item.she_bei_shi_bie_h,
+                        model: item.gui_ge_xing_hao_,
+                        verifier: this.findPersonName(item.bi_xu_de_huan_jin, personData),
+                        verificationDate: verificationDateStr.substring(0, 10)
+                    }
+                    list.push(o)
+                    console.log(o)
+                })
+                this.list = list
+            })
+        },
+        judgementVal (value) {
+            return value != null && value != undefined
+        },
+        switchProve (status) {
+            return `${this.stateList[status] || '测试'}证`
+        },
+        switchSlogan (status) {
+            switch (status) {
+                case '合格':
+                    return 'PASS'
+                case '停用':
+                    return 'STOP'
+                case '限用':
+                    return 'RESTRICT'
+                case '报废':
+                    return 'SCRAP'
+                default:
+                    return 'TEST'
             }
-            list.push(o)
-          })
-          this.list = list
-      })
-    },
-    getTime(second) {
-      let date =new Date(second);
-      let year = date.getFullYear();
-      let month = ''
-      let day = ''
-      if((date.getMonth()+1)<=9){
-        month = "0"+ (date.getMonth()+1)
-      }else{
-        month = date.getMonth()+1
-      }
-      if(date.getDate()<=9){
-        day =  "0"+date.getDate();
-      }else {
-        day =  date.getDate();
-      }
-        return year + "-"+month+"-"+day;
-    },
-    findPersonName(id,personData) {
-            if(!personData)
-                return '保管人列表为空'
-            if(!id)
-                return ''
+        },
+        findPersonName (id, personData) {
+            if (!personData) { return '核查人列表为空' }
+            if (!id) { return '' }
             return personData.find(i => i.id_ === id).NAME_
         }
-  }
+    }
 }
 </script>
 
 <style lang="scss" scoped>
+.All {
+  text-align: center;
+  margin: 10px 0px;
+}
+
 .bg {
   // height: auto;
 }
-.All{
-  text-align: center
-}
-// .tagBox {
-//   width: 283px;   // 300  240
-//   height: 283px;  // 180  150  94
-//   position: relative;
-//   border: 2px solid #000000;
-//   padding: 5px;
-//   display: inline-block;
-//   // justify-content: space-around;
-//   // flex-direction: column;
-//   margin: 10px 5px;
-//   border-radius: 4px;
-//   background-color: #fff;
-// }
 
-.tagBox{
-  width: 231px; //300
-//   height: 240px;
+.tagBox {
+  width: 250px; // 300  240 231
   position: relative;
-  border: 1px solid #000;
-//   font-size: 14px;
-  padding: 2px;
+  border: 1px solid #000000;
+  border-top: 0px;
   display: inline-block;
-  margin: 10px auto 10px;
-  border-radius: 4px;
+  background-color: #fff;
 }
-.ewm{
 
+.ewm {
+  margin-left: 10px;
 }
-/*
-.tagBox {
-  width: 177.5px;   // 300  240
-  height: 106.5px;  // 180  150
-  position: relative;
-  border: 1px solid #000000;
-  padding: 20px;
-  display: flex;
-  justify-content: space-around;
-  flex-direction: column;
-  margin: 20px auto;
-  border-radius: 15px;
-  background-color: #fff;
+.qianZhi {
+  white-space: nowrap
 }
-*/
 
 .la {
+  font-size: 12px; //16
   display: flex;
   align-items: center;
+  padding: 1px;
+  width: 50%;
+}
+
+.zuoJuZhong {
+  text-align: left;
 }
 
 .lh {
-  // line-height: auto;
-  font-size: 12px;  //16
   display: flex;
   align-items: center;
   padding: 1px;
+  font-size: 12px; //16
+  display: flex;
+  align-items: center;
+  border-bottom: 1px solid #000000;
+}
+
+.container {
+  width: 250px;
+  height: 50px;
+  position: relative;
+  border: 1px solid #000000;
+}
+
+.triangle,
+.triangleYellow,
+.triangleRed,
+.triangleGray {
+  width: 0;
+  height: 0;
+  position: relative;
+  border-right: 125px solid transparent;
+  border-left: 125px solid transparent;
+  border-bottom: 125px solid transparent;
+  text-align: center;
+}
+
+.triangle {
+  border-top: 50px solid #008000;
+}
+
+.triangleYellow {
+  border-top: 50px solid #ffff00;
+}
+
+.triangleRed {
+  border-top: 50px solid #ff0000;
+}
+.triangleGray {
+  border-top: 50px solid #909399;
+}
+.triangle>.label,
+.triangleYellow>.label,
+.triangleRed>.label,
+.triangleGray>.label {
+  width: 100px;
+  position: relative;
+  top: -45px;
+  left: -50px;
+  font-size: 20px;
+  font-weight: bold;
+  color: #000000;
+}
+
+.top-triangle {
+  border-left: 100px solid transparent;
+  border-right: 100px solid transparent;
+  top: 0;
+  left: 0;
+}
+
+.left-triangle {
+  /* border-top: 100px solid transparent; */
+  border-right: 100px solid black;
+  border-bottom: 50px solid rgb(217, 217, 233);
+  top: 0;
+  left: 0;
+}
 
+.right-triangle {
+  border-left: 100px solid black;//red
+  border-bottom: 50px solid rgb(217, 217, 233);
+  top: 0;
+  left: 100px;
+}
+
+.one {
+  justify-content: center;
+  align-items: center;
+  display: flex;
 }
 </style>

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików