zrg
2026-01-21 95bdecb4b73270f48bd46c628e9d6cf3ddccc92b
Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev
3个文件已添加
6个文件已修改
1899 ■■■■■ 已修改文件
pages.json 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/Sb_EqpMaintenance/Sb_EqpMaintenanceBill.vue 938 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/Sb_EqpMaintenance/Sb_EqpMaintenanceBillList.vue 460 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBillList.vue 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/Sc_EquipmentProcessList/Sc_EquipmentProcess.vue 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/Sc_OEEStatusReport/Sc_OEEStatusReport.vue 313 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/tab2.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/tab3.vue 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/shebeiyunxingzhuangtai/detail.vue 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json
@@ -1632,7 +1632,7 @@
            "path" : "pages/MJGL/Sb_EquipStop/Sb_EquipStopBill",
            "style" : 
            {
                "navigationBarTitleText" : ""
                "navigationBarTitleText" : "设备停机单"
            }
        },
        {
@@ -1655,6 +1655,27 @@
            {
                "navigationBarTitleText" : "设备工艺路线"
            }
        },
        {
            "path" : "pages/MJGL/Sb_EqpMaintenance/Sb_EqpMaintenanceBill",
            "style" :
            {
                "navigationBarTitleText" : "设备维修记录单"
            }
        },
        {
            "path" : "pages/MJGL/Sc_OEEStatusReport/Sc_OEEStatusReport",
            "style" :
            {
                "navigationBarTitleText" : "设备状态"
            }
        },
        {
            "path" : "pages/MJGL/Sb_EqpMaintenance/Sb_EqpMaintenanceBillList",
            "style" :
            {
                "navigationBarTitleText" : "设备维修记录单列表"
            }
        }
        
pages/MJGL/Sb_EqpMaintenance/Sb_EqpMaintenanceBill.vue
New file
@@ -0,0 +1,938 @@
<template>
    <view>
        <view class="tabs" id="tabs">
            <view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">基本信息</view>
            <view :class="tabs == 2 ? 'on':''" @tap="tabs = 2">其他信息</view>
        </view>
        <!-- 基本信息 -->
        <template v-if="tabs == 0">
            <view class="form" :style="{
                height: containerHeight + 'px',
                overflow: 'auto'
            }">
                <view class="form-item">
                    <view class="title">设备条码:</view>
                    <view :class="enableEdit?'right':'righton'">
                        <input v-model="hform.HBarCode" :disabled="!enableEdit"
                            @confirm="GetMessageByBarCode(hform.HBarCode)" placeholder="请输入(或扫描)设备条码" />
                    </view>
                    <view class="icon-wrapper">
                        <uni-icons type="scan" size="20" @click="toScanCode"></uni-icons>
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">维修开始:</view>
                    <view class="right">
                        <uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HRepairPlanBeginDate">
                            <input :value="hform.HRepairBeginDate" />
                        </uni-datetime-picker>
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">维修结束:</view>
                    <view class="right">
                        <uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HRepairPlanEndDate">
                            <input :value="hform.HRepairEndDate" />
                        </uni-datetime-picker>
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">维修内容:</view>
                    <view class="right">
                        <textarea v-model="hform.HRepairContent" placeholder="请输入维修内容" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">单据号:</view>
                    <view class="righton">
                        <input disabled v-model="hform.HBillNo" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">单据日期:</view>
                    <view class="righton">
                        <input disabled v-model="hform.HDate" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">源单类型:</view>
                    <zxz-uni-data-select class="right" :localdata="[
                        {key: '设备维修登记单', value: '设备维修登记单'},
                        {key: '手工录入', value: '手工录入'},
                        {key: '设备维修派工单', value: '设备维修派工单'},
                    ]" dataKey="key" dataValue="value" v-model="hform.HMainSourceBillType">
                    </zxz-uni-data-select>
                </view>
                <view class="form-item">
                    <view class="title">故障登记单:</view>
                    <view :class="enableSourceBillEdit?'right':'righton'" >
                        <input v-model="hform.HMainSourceBillNo" :disabled="enableSourceBillEdit?false:true"
                            @confirm="GetMessageByHMainSourceBillNo(hform.HMainSourceBillNo)"
                            placeholder="请输入(或扫描)故障登记单" />
                    </view>
                    <view class="icon-wrapper">
                        <uni-icons type="scan" size="20" @click="toScanHMainSourceBillNo"></uni-icons>
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">维修要求:</view>
                    <view class="right">
                        <textarea v-model="hform.HExplanation" placeholder="请输入维修要求" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">时间单位:</view>
                    <zxz-uni-data-select class="right" :localdata="[
                        {key: '小时', value: '小时'},
                        {key: '天', value: '天'},
                        {key: '月', value: '月'},
                    ]" dataKey="key" dataValue="value" v-model="hform.HCycleUnit">
                    </zxz-uni-data-select>
                </view>
                <view class="form-item">
                    <view class="title">维修工时:</view>
                    <view class="right">
                        <input type="number" v-model="hform.HTimes" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title required">部门:</view>
                    <zxz-uni-data-select required class="right" :localdata="HDeptList" dataKey="部门名称"
                        dataValue="HItemID" v-model="hform.HDeptID">
                    </zxz-uni-data-select>
                    <!-- <input disabled v-model="hform.HDeptName" placeholder="请选择部门" /> -->
                </view>
                <view class="form-item">
                    <view class="title required">维修人:</view>
                    <zxz-uni-data-select required class="right" :localdata="HEmpList" dataKey="HName"
                        dataValue="HItemID" v-model="hform.HEmpID">
                    </zxz-uni-data-select>
                    <!-- <input disabled v-model="hform.HDeptName" placeholder="请选择部门" /> -->
                </view>
                <view class="form-item">
                    <view class="title required">维修项目:</view>
                    <zxz-uni-data-select required class="right" :localdata="HRepairList" dataKey="维修项目"
                        dataValue="hitemid" v-model="hform.HRepairID">
                    </zxz-uni-data-select>
                    <!-- <input disabled v-model="hform.HDeptName" placeholder="请选择部门" /> -->
                </view>
                <view class="form-item">
                    <view class="title required">负责人:</view>
                    <zxz-uni-data-select required class="right" :localdata="HEmpList" dataKey="HName"
                        dataValue="HItemID" v-model="hform.HManagerID">
                    </zxz-uni-data-select>
                    <!-- <input disabled v-model="hform.HDeptName" placeholder="请选择部门" /> -->
                </view>
                <view class="form-item">
                    <view class="title">设备名称:</view>
                    <view class="righton">
                        <input v-model="hform.HBarName" disabled />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">设备规格:</view>
                    <view class="righton">
                        <input v-model="hform.HBarSpec" disabled />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">设备型号:</view>
                    <view class="righton">
                        <input v-model="hform.HBarModel" disabled />
                    </view>
                </view>
            </view>
        </template>
        <!-- 其他信息 -->
        <template v-if="tabs == 2">
            <view class="form" :style="{
                height: containerHeight + 'px',
                overflow: 'auto'
            }">
                <view class="form-item">
                    <view class="title">创建人:</view>
                    <view class="righton">
                        <input v-model="hform.HMaker" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">创建日期:</view>
                    <view class="righton">
                        <input v-model="hform.HMakeDate" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">修改人:</view>
                    <view class="righton">
                        <input v-model="hform.HUpDater" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">修改日期:</view>
                    <view class="righton">
                        <input v-model="hform.HUpDateDate" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">审核人:</view>
                    <view class="righton">
                        <input v-model="hform.HChecker" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">审核时间:</view>
                    <view class="righton">
                        <input v-model="hform.HCheckDate" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">作废人:</view>
                    <view class="righton">
                        <input v-model="hform.HDeleteMan" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">作废日期:</view>
                    <view class="righton">
                        <input v-model="hform.HDeleteDate" />
                    </view>
                </view>
            </view>
        </template>
        <!-- 操作按钮 -->
        <view class="buttons" id="buttons">
            <button class="btn-a" size="mini" @tap="submit">提交</button>
            <view style="flex: 1;"></view>
            <button class="btn-a" v-if="operationType!=4" size="mini" @tap="addNew">新增</button>
            <button class="btn-c" size="mini" @tap="goBack">退出</button>
        </view>
        <!-- <xe-upload ref="XeUpload" :options="uploadOptions" @callback="handleUploadCallback"></xe-upload> -->
    </view>
</template>
<script>
    import dayjs from "dayjs";
    import {
        CommonUtils
    } from "@/utils/common";
    import {
        MpaasScan
    } from "@/utils/mpaasScan.js"
    import {
        getUserInfo
    } from "../../../utils/auth";
    export default {
        // 设备维修记录单
        name: 'Sb_EqpMaintenanceBill',
        data() {
            return {
                tabs: 0,
                HMainSourceBillType: "",
                btnTop: 0,
                tabsBottom: 0,
                HModName: "Sb_EqpMaintenanceBill",
                HBillType: '3910',
                operationType: 1,
                uploadOptions: {},
                enableEdit: true,
                enableSourceBillEdit: true,
                HDeptList: [],
                HRepairCheckList: [],
                HEmpList: [],
                HRepairList: [],
                hform: {
                    HBarCode: "",
                    HBarCode: '',
                    HRepairBeginDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
                    HRepairEndDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
                    HRepairContent: '',
                    HBillNo: '',
                    HInterID: 0,
                    HDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
                    HDeptName: '',
                    HDeptID: 0,
                    HEmpName: '',
                    HEmpID: 0,
                    HRepair: '',
                    HRepairID: 0,
                    HExplanation: '',
                    HMainSourceBillType: '设备维修登记单',
                    HMainSourceBillNo: '',
                    HMainSourceInterID: 0,
                    HMainSourceEntryID: 0,
                    HManagerName: '',
                    HManagerID: 0,
                    HTimes: '',
                    HCycleUnit: '小时',
                    HBarName: '',
                    HNumber: '',
                    HEquipID: 0,
                    HBarSpec: '',
                    HBarModel: '',
                    HMaker: getUserInfo()["Czymc"],
                    HChecker: '',
                    HCloseMan: '',
                    HUpDater: '',
                    HMakeDate: dayjs(new Date()).format("YYYY-MM-DD"),
                    HCheckDate: '',
                    HCloseDate: '',
                    HUpDateDate: '',
                    HDeleteMan: '',
                    HDeleteDate: ''
                },
                HDetailList: [{
                    "HRepairID": 0,
                    "HRepairCode": "",
                    "HRepairName": "",
                    "HManagerID": 0,
                    "HManagerCode": "",
                    "HManagerName": "",
                    "HRepairExplanation": '',
                    "HRemark": "",
                    "HEmpID": '',
                    "HSourceInterID": 0,
                    "HSourceEntryID": 0,
                    "HSourceBillNo": ''
                }]
            };
        },
        computed: {
            containerHeight: {
                get() {
                    return this.btnTop - this.tabsBottom - 5
                }
            },
        },
        methods: {
            // 维修项目
            async getRepairList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: '/Gy_Repair/GetRepairList',
                        data: {
                            sWhere: '',
                            user: getUserInfo()["Czymc"]
                        }
                    })
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        this.HRepairList = data
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: `获取检验项目失败: ${Message}`
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: `获取检验项目失败: ${err}`
                    })
                }
            },
            // 删除明细
            delDetail(item) {
            },
            // 提交数据有效性校验
            ValidCheck() {
                if (this.hform.HEquipID == 0) {
                    return {
                        Message: "未录入设备信息,请先录入设备信息!",
                        state: false
                    }
                }
                if (this.hform.HDeptID == 0) {
                    return {
                        Message: "部门不得为空!",
                        state: false
                    }
                }
                if (this.hform.HEmpID == 0) {
                    return {
                        Message: "验收人不得为空!",
                        state: false
                    }
                }
                if (this.hform.HRepairCheckMainID == 0) {
                    return {
                        Message: "验证项目不得为空!",
                        state: false
                    }
                }
                if (this.hform.HManagerID == 0) {
                    return {
                        Message: "负责人不得为空!",
                        state: false
                    }
                }
                return {
                    Message: "",
                    state: true
                }
            },
            addNew() {
                uni.redirectTo({
                    url: './Sb_EquipRepairSendWorkBill?operationType=1'
                })
            },
            goBack() {
                uni.navigateBack()
            },
            checkBoxChangeHandler(index, e) {
                let cr = e.detail.value
                if (cr.length == 0) {
                    this.HCheckFileList[index]["HDotCheckResult"] = false
                } else {
                    this.HCheckFileList[index]["HDotCheckResult"] = true
                }
            },
            uploadFile(index) {
                console.log('filePath: ', this.attachmentInfo[index].filePath);
                // 通过临时路径读取文件
                uni.uploadFile({
                    url: CommonUtils.getServerUrl() + "/Sb_EquipDotCheckBill/UploadFile",
                    filePath: this.attachmentInfo[index].filePath,
                    name: 'file',
                    formData: {
                        HBillNo: this.hform.HBillNo,
                        HRemark: "",
                        HUserName: getUserInfo()["Czymc"]
                    },
                    success: (uploadRes) => {
                        CommonUtils.showTips({
                            message: "上传成功"
                        })
                        this.attachmentInfo[index].status = "上传成功"
                    },
                    fail: (err) => {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: `上传失败: ${err}`
                        })
                    }
                })
            },
            delFile(index) {
                console.log('attachmentInfo: ', this.attachmentInfo[index]);
                uni.showModal({
                    title: '提示',
                    content: '确认要删除 " ' + this.attachmentInfo[index].fileName + ' " 删除后将不可恢复!',
                    success: (res) => {
                        if (res.confirm) {
                            this.attachmentInfo.splice(index, 1)
                        }
                    },
                })
            },
            handleUploadCallback(res) { // 文件上传回调
                console.log('file: ', res);
                let fileInfo = res.data[0]
                this.attachmentInfo.push({
                    fileName: fileInfo.name,
                    size: fileInfo.size,
                    status: '等待上传',
                    filePath: fileInfo.tempFilePath
                })
            },
            // 上传文件
            fileUpload() {
                this.$refs.XeUpload.upload('file', {});
            },
            //获取班次数据
            async getShiftList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: '/Web/GetGy_ShiftsList_Json',
                        data: {
                            Shifts: "",
                        }
                    })
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        this.HShiftsList = data
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: err
                    })
                }
            },
            //获取使用部门数据
            async getHDeptList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: '/Gy_Department/list',
                        data: {
                            sWhere: ` and HUSEORGID = ${uni.getStorageSync('OrganizationID')} `,
                            user: uni.getStorageSync('HUserName'),
                            Organization: uni.getStorageSync('Organization')
                        }
                    })
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        this.HDeptList = data
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: err
                    })
                }
            },
            // 获取职员数据
            async getEmpList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: '/PublicPageMethod/UserList',
                        data: {
                            sWhere: " where 1=1",
                        }
                    })
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        this.HEmpList = data
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: err
                    })
                }
            },
            // 获取验证项目数据
            async getCheckProjList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: '/Gy_RepairCheck/GetRepairCheckList',
                        data: {
                            sWhere: "",
                            user: uni.getStorageSync('HUserName'),
                        }
                    })
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        this.HRepairCheckList = data
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: err
                    })
                }
            },
            toScanCode() {
                MpaasScan.scanCode(cb => {
                    this.hfrom.HBarCode = cb
                    this.GetMessageByBarCode(cb)
                })
            },
            toScanHMainSourceBillNo() {
                MpaasScan.scanCode(cb => {
                    this.hfrom.HMainSourceBillNo = cb
                    this.GetMessageByHMainSourceBillNo(cb)
                })
            },
            async GetMessageByHMainSourceBillNo(HSouceBillNo) {
                try{
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Sb_EqpRepairWorkBill/GetEqpConkBookBillListPage",
                        data: {
                            sWhere: ` and 单据号 = '${HSouceBillNo}'`,
                            user: getUserInfo()["Czymc"],
                            page: 1,
                            size: 1,
                        }
                    })
                    let {count, Message, data} = res.data
                    if(count == 1) {
                        this.hform.HMainSourceBillNo = data[0]["单据号"]
                        this.hform.HMainSourceInterID = data[0]["hmainid"]
                        this.hform.HMainSourceEntryID = data[0]["hsubid"]
                    }else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `获取维修登记单失败: ${Message}`
                        })
                    }
                }catch(err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `获取维修登记单失败: ${err}`
                    })
                }
            },
            async GetMessageByBarCode(HBarCode) {
                try {
                    let res = await CommonUtils.doRequest2Sync({
                        url: "/Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_List",
                        data: {
                            HBarCode: HBarCode,
                        },
                    })
                    if (!res) {
                        return
                    }
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        console.log('data: ', data);
                        this.hform.HEquipID = data[0].hmainid
                        this.hform.HBarName = data[0].设备名称
                        this.hform.HBarSpec = data[0].设备规格
                        this.hform.HBarModel = data[0].设备型号
                        this.hform.HQty = 1
                        this.enableEdit = false
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: err
                    })
                }
            },
            async GetItemByEquipFile() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Web/GetItemByEquipFile",
                        data: {
                            "EquipProjectID": this.hform.HEquipID,
                            "Type": "DJ",
                            "HDate": this.hform.HBeginDate
                        }
                    })
                    let {
                        data,
                        Message,
                        count
                    } = res.data
                    if (count == 1) {
                        this.hform.HEquipDotCheckRuleInterID = data[0].点检规程ID
                        this.hform.HEquipDotCheckRuleInterNo = data[0].点检规程单号
                        this.hform.HPlanNo = data[0].点检计划单
                        this.hform.HPlanInterID = (data[0].点检计划ID == null ? 0 : data[0].点检计划ID) == "" ? 0 : data[0]
                            .点检计划ID
                        this.hform.HPlanEntryID = (data[0].点检计划子ID == null ? 0 : data[0].点检计划子ID) == "" ? 0 : data[
                            0].点检计划子ID
                        this.HCheckFileList = Array.from(data).map(item => {
                            return {
                                "HDotCheckItemID": item.HDotCheckItemID,
                                "HDotCheckCode": item.点检项目代码,
                                "HDotCheckItem": item.点检项目,
                                "HDotCheckPart": item.点检部位,
                                "HClaim": item.具体要求,
                                "HManagerID": item.负责人ID,
                                "HManagerCode": item.负责人代码,
                                "HManagerName": item.负责人名称,
                                "HSourceInterID": item.点检计划ID == null ? 0 : item.点检计划ID,
                                "HSourceEntryID": item.点检计划子ID == null ? 0 : item.点检计划子ID,
                                "HSourceBillNo": item.点检计划单,
                                "HDotCheckItemClassID": 0,
                                "HDotCheckItemClassName": "",
                                "HDotCheckItemMethodID": 0,
                                "HDotCheckItemMethodName": "",
                                "HDotCheckResult": item.默认结论 == 1 ? true : false
                            }
                        })
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: `获取点检规程错误: ${Message}`
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: `获取点检规程错误: ${err}`
                    })
                }
            },
            radioChange({
                detail: {
                    value
                }
            }) {
                this.hform.HCheckResult = value
            },
            async getMaxNum() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Web/GetMAXNum",
                        data: {
                            "HBillType": this.HBillType
                        }
                    })
                    let {
                        count,
                        data,
                        Message
                    } = res.data
                    console.log('data: ', data);
                    this.hform.HInterID = data[0]["HInterID"]
                    this.hform.HBillNo = data[0]["HBillNo"]
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: "获取单据信息异常: " + err
                    })
                }
            },
            async submit() {
                let valid = this.ValidCheck()
                if (!valid.state) {
                    CommonUtils.showTips({
                        message: valid.Message
                    })
                    return
                }
                try {
                    let oMain = JSON.stringify(this.hform);
                    this.HDetailList[0].HManagerID = this.hform.HManagerID
                    this.HDetailList[0].HRepairID = this.hform.HRepairID
                    this.HDetailList[0].HRepairExplanation = this.hform.HExplanation
                    this.HDetailList[0].HEmpID = this.hform.HEmpID
                    this.HDetailList[0].HSourceInterID = this.hform.HMainSourceInterID
                    this.HDetailList[0].HSourceEntryID = this.hform.HMainSourceEntryID
                    this.HDetailList[0].HSourceBillNo = this.hform.HMainSourceBillNo
                    let sSubStr = JSON.stringify(this.HDetailList);
                    let sMainSub = oMain + ';' + sSubStr + `;-1;${this.operationType}` + ';' + getUserInfo()[
                        'Czymc'];
                    let res = await CommonUtils.doRequest2Sync({
                        url: "/Sb_PDA_EqpRepairWorkBill/SaveGetEqpRepairWorkBillList",
                        data: {
                            "msg": sMainSub
                        },
                        method: "POST"
                    })
                    if (!res) {
                        return
                    }
                    let {
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        if(this.operationType == 4) {
                            uni.showModal({
                                title: '提示',
                                content: res.data.Message + '。即将返回上级页面',
                                showCancel: false,
                                success: (res) => {
                                    if (res.confirm) {
                                        console.log('用户点击确定');
                                        setTimeout(() => {
                                            uni.navigateBack();
                                        }, 50)
                                        // uni.redirectTo({
                                        //     url: './Sb_EquipRepairSendWorkBill?operationType=1'
                                        // })
                                    } else if (res.cancel) {
                                        console.log('用户点击取消');
                                        setTimeout(() => {
                                            uni.navigateBack();
                                        }, 50)
                                    }
                                }
                            });
                            return
                        }
                        uni.showModal({
                            title: '提示',
                            content: res.data.Message + '。是否继续新增?(点击取消返回上级页面)',
                            success: (res) => {
                                if (res.confirm) {
                                    console.log('用户点击确定');
                                    uni.redirectTo({
                                        url: './Sb_EquipRepairSendWorkBill?operationType=1'
                                    })
                                } else if (res.cancel) {
                                    console.log('用户点击取消');
                                    setTimeout(() => {
                                        uni.navigateBack();
                                    }, 50)
                                }
                            }
                        });
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: "提交单据失败: " + Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: "提交单据失败: " + err
                    })
                }
            },
            async getEquipFileMain(HInterID) {
                try {
                    let res = await CommonUtils.doRequest2Sync({
                        url: "/Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_ListByHEquipID",
                        data: {
                            HEquipID: HInterID,
                        },
                    })
                    if (!res) {
                        return
                    }
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        console.log('data: ', data);
                        this.hform.HEquipID = data[0].hmainid
                        this.hform.HBarName = data[0].设备名称
                        this.hform.HBarSpec = data[0].设备规格
                        this.hform.HBarModel = data[0].设备型号
                        this.hform.HQty = 1
                        this.enableEdit = false
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: err
                    })
                }
            }
        },
        onLoad(e) {
            console.log('e: ', e);
            if (!e.operationType) {
                this.operationType = 1
            } else {
                this.operationType = e.operationType
            }
            if (this.operationType == 1) {
                // 新增
                this.getMaxNum()
            } else if (this.operationType == 2) {
                // 复制
            } else if (this.operationType == 3) {
                // 编辑
            } else if (this.operationType == 4) {
                // 由报工平台打开
                let HEquipID = e.HEquipID
                this.getMaxNum()
                this.getEquipFileMain(HEquipID)
            }
            this.getHDeptList()
            this.getEmpList()
            this.getRepairList()
        },
        onReady() {
            const query = uni.createSelectorQuery().in(this)
            query.select("#buttons")
                .boundingClientRect()
                .select("#tabs")
                .boundingClientRect()
                .exec(res => {
                    this.btnTop = Math.floor(res[0].top)
                    this.tabsBottom = Math.ceil(res[1].bottom)
                })
        }
    }
</script>
<style lang="scss" scoped>
    @import "@/pages/MJGL/style/MJBillStyle.scss"
</style>
pages/MJGL/Sb_EqpMaintenance/Sb_EqpMaintenanceBillList.vue
New file
@@ -0,0 +1,460 @@
<template>
    <view class="content">
        <view class="form">
            <view class="form-item">
                <view class="title">开始时间:</view>
                <view class="right">
                    <uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HBeginDate">
                        <input :value="hform.HBeginDate" />
                    </uni-datetime-picker>
                </view>
            </view>
            <view class="form-item">
                <view class="title">结束时间:</view>
                <view class="right">
                    <uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HEndDate">
                        <input :value="hform.HEndDate" />
                    </uni-datetime-picker>
                </view>
            </view>
            <view v-if="showmore">
                <view class="form-item">
                    <view class="title">单据号:</view>
                    <view class="right">
                        <input v-model="hform.HBillNo" placeholder="请输入单据号" />
                    </view>
                </view>
            </view>
            <view class="other">
                <view v-if="!showmore" @tap="changeShowMore">
                    展开其他条件<uni-icons color="#1890FF" style="margin-left: 8rpx;" type="bottom"></uni-icons>
                </view>
                <view v-if="showmore" @tap="changeShowMore">
                    折叠其他条件<uni-icons color="#1890FF" style="margin-left: 8rpx;" type="top"></uni-icons>
                </view>
            </view>
            <view class="buttons">
                <button class="btn-a" size="mini" type="default" @tap="clear">重置</button>
                <button class="btn-b" size="mini" type="default" @tap="add">新增</button>
                <button class="btn-c" size="mini" type="default" @tap="search">查询</button>
            </view>
        </view>
        <view id="divide" style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
        <view :style="{
            height: calcContentHeight + 'px',
            overflowY: 'auto'
        }">
            <view class="list" v-for="(item,index) in showList" :key="index" v-if="tabs==0">
                <uni-card :title="item.制单日期.substr(0,10)" :extra="item.单据号" style="margin: 10px;"
                    @tap="showDetail = showDetail==index?-1:index">
                    <view class="card-detail">
                        <template
                            v-for="(HBillField, index) in CommonUtils.emptyValueFilter(item,HFieldList).slice(0,10)">
                            <view class="detail" v-if="HBillField.ColmType == 'DateTime'">
                                <text>{{ HBillField.ColmCols }}:</text>{{ item[HBillField.ColmCols] ? dayjs(item[HBillField.ColmCols]).format("YYYY-MM-DD HH:mm:ss") : "" }}
                            </view>
                            <view class="detail" v-else>
                                <text>{{ HBillField.ColmCols }}:</text>{{ item[HBillField.ColmCols] }}
                            </view>
                        </template>
                    </view>
                    <view class="card-detail" v-if="showDetail == index">
                        <view class="card-detail">
                            <template
                                v-for="(HBillField, index) in CommonUtils.emptyValueFilter(item,HFieldList).slice(10,-1)">
                                <view class="detail" v-if="HBillField.ColmType == 'DateTime'">
                                    <text>{{ HBillField.ColmCols }}:</text>{{ item[HBillField.ColmCols] ? dayjs(item[HBillField.ColmCols]).format("YYYY-MM-DD HH:mm:ss") : "" }}
                                </view>
                                <view class="detail" v-else>
                                    <text>{{ HBillField.ColmCols }}:</text>{{ item[HBillField.ColmCols] }}</view>
                            </template>
                        </view>
                    </view>
                    <view class="more" v-if="showDetail == index && operations != index">
                        <view class="part" style="border-right: 1px solid #eee;">
                            <uni-icons type="top" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>收起
                        </view>
                        <view class="part" @tap.stop="operations = operations==index?-1:index">
                            <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;"
                                size="14"></uni-icons>操作
                        </view>
                    </view>
                    <view class="more" v-if="showDetail != index && operations != index">
                        <view class="part" style="border-right: 1px solid #eee;">
                            <uni-icons type="bottom" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>更多信息
                        </view>
                        <view class="part" @tap.stop="operations = operations==index?-1:index">
                            <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;"
                                size="14"></uni-icons>操作
                        </view>
                    </view>
                    <view class="op" v-if="operations == index">
                        <!-- <button class="op3" size="mini" plain @tap.stop="edit(item)">编辑</button> -->
                        <button class="op4" size="mini" plain @tap.stop="del(item)">删除</button>
                        <button class="op5" size="mini" plain @tap.stop="operations = -1">取消操作</button>
                    </view>
                </uni-card>
            </view>
        </view>
        <view class="pagination-zone" id="pagination-zone">
            <uni-pagination show-icon :page-size="size" :total="dataLength" :current="page"
                @change="onPaginationChangeHandler"></uni-pagination>
        </view>
        <BarCodePopupVue ref="barcodePopup"></BarCodePopupVue>
    </view>
</template>
<script>
    import {
        getUserInfo
    } from "@/utils/auth.js";
    import BarCodePopupVue from "@/components/BarCodePopup/BarCodePopup.vue";
    import {
        CommonUtils
    } from "@/utils/common";
    import dayjs from "dayjs";
    export default {
        data() {
            return {
                dayjs,
                CommonUtils,
                userInfo: getUserInfo(),
                serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
                tabs: 0,
                urls: '/Web/GetEquipmentBillsList',
                MvarReportTitle: '设备维修记录单缓存',
                hform: {
                    HBillNo: '',
                    HSourceBillNo: '',
                    HBillType: '',
                    user: uni.getStorageSync('HUserName'),
                    HStockOrgID: uni.getStorageSync('OrganizationID'),
                    Type: "WX",
                    sWhere: "",
                    HBeginDate: dayjs(new Date()).subtract(30, 'day').format("YYYY-MM-DD"),
                    HEndDate: dayjs(new Date()).format("YYYY-MM-DD"),
                },
                sWhere: '',
                listData: [],
                showList: [],
                HFieldList: [],
                showDetail: -1,
                operations: -1,
                page: 1,
                size: 20,
                dataLength: 0,
                divideBottom: 0,
                paginationTop: 0,
                showmore: false,
            }
        },
        computed: {
            calcContentHeight: {
                get() {
                    return this.paginationTop - this.divideBottom
                }
            }
        },
        onShow() {
            //用户模块权限判断
            // this.CheckModRight()
            this.changeTab(0)
            console.log(this.userInfo, uni.getStorageSync('HUserName'))
        },
        components: {
            BarCodePopupVue
        },
        onPullDownRefresh: function() {
            this.clear()
            setTimeout(() => {
                uni.stopPullDownRefresh();
            }, 1000);
        },
        onReady() {
            this.getCalcHeight()
        },
        methods: {
            changeShowMore() {
                this.showmore = !this.showmore
                this.$nextTick(() => {
                    // 重新计算内容视口高度
                    this.getCalcHeight()
                })
            },
            getCalcHeight() {
                let query = uni.createSelectorQuery().in(this)
                query
                    .select("#divide")
                    .boundingClientRect()
                    .select("#pagination-zone")
                    .boundingClientRect()
                    .exec(res => {
                        this.divideBottom = Math.ceil(res[0].bottom)
                        this.paginationTop = Math.floor(res[1].top)
                    })
            },
            async qrCodeDisplay(item) {
                this.$refs.barcodePopup.setCodeInfo(item.HBillNo)
                await this.$nextTick()
                this.$refs.barcodePopup.open()
            },
            CheckModRight() {
                uni.request({
                    url: this.serverUrl + '/WEBSController/CheckModRight_Json',
                    data: {
                        ModRightName: 'CE_OtherOut',
                        HUserName: uni.getStorageSync('HUserName')
                    },
                    success: (res) => {
                        if (res.data.count == 1) {} else {
                            uni.showToast({
                                title: res.data.Message,
                                icon: 'none'
                            })
                        }
                    },
                    fail: (res) => {
                        console.log(res);
                        uni.showToast({
                            title: '接口请求失败',
                            icon: 'none'
                        })
                    },
                });
            },
            onPaginationChangeHandler({
                current
            }) {
                this.page = current
                this.showList = this.getPage(current, this.size, this.listData)
            },
            getPage(page, size, list) {
                let sindex = (parseInt(page) - 1) * size
                let eindex = parseInt(page) * size
                let newList = list.slice(sindex, eindex)
                return newList
            },
            changeTab(e) {
                this.tabs = e
                this.page = 1
                this.showList = []
                if (this.tabs == 0) {
                    this.urls = '/Web/GetEquipmentBillsList'
                }
                // if (this.tabs == 1) {
                //     this.urls = '/WEBSController/GetKf_ICStockBillQueryList_User_Json'
                // }
                this.search()
            },
            async getList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: this.urls,
                        data: this.hform
                    })
                    let {
                        count,
                        data,
                        Message,
                        list
                    } = res.data
                    if (count == 1) {
                        if (data == null) {
                            data = []
                        }
                        this.listData = data
                        this.showList = this.getPage(this.page, this.size, data)
                        this.dataLength = data.length
                        this.HFieldList = CommonUtils.fieldListFilterRole({
                            ExcludeKeys: ["制单日期", "单据号"],
                            FieldList: Array.from(list)
                        }).data
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `获取设备故障登记单失败: ${Message}`
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `获取设备故障登记单失败: ${err}`
                    })
                }
            },
            search() {
                this.hform.sWhere = ''
                this.listData = []
                this.page = 1
                this.showList = []
                if (this.hform.HBillNo) {
                    this.hform.sWhere += " and 单据号 like '%" + this.hform.HBillNo + "%'";
                }
                if (this.hform.HBeginDate && this.hform.HEndDate) {
                    this.hform.sWhere +=
                        ` and convert(date,日期) between convert(date, '${this.hform.HBeginDate}') and convert(date, '${this.hform.HEndDate}')`;
                }
                this.getList()
            },
            clear() {
                this.listData = []
                this.page = 1
                this.showList = []
                this.sWhere = ''
                this.hform = {
                    HBillNo: '',
                    HSourceBillNo: '',
                    HBillType: '',
                    user: uni.getStorageSync('HUserName'),
                    HStockOrgID: uni.getStorageSync('OrganizationID'),
                    Type: "WX",
                    sWhere: "",
                    HBeginDate: dayjs(new Date()).subtract(30, 'day').format("YYYY-MM-DD"),
                    HEndDate: dayjs(new Date()).format("YYYY-MM-DD"),
                }
                this.search()
            },
            add() {
                uni.navigateTo({
                    url: '/pages/MJGL/Sb_EqpMaintenance/Sb_EqpMaintenanceBill?operationType=1'
                })
            },
            //编辑
            edit(item) {
                return
                console.log(item)
                uni.request({
                    url: this.serverUrl + '/WEBSController/TempList_Modify_Json',
                    data: {
                        "HInterID": item.HInterID,
                        "HBillNo": item.单据号,
                        "HBillType": this.hform.HBillType
                    },
                    success: (res) => {
                        console.log(1, res);
                        if (res.data.count == 1) {
                            uni.navigateTo({
                                url: './OtherOutBill?OperationType=2&HInterID=' + item.HInterID
                            })
                        } else {
                            uni.showToast({
                                title: res.data.Message,
                                icon: 'none'
                            })
                        }
                    },
                    fail: (res) => {
                        console.log(res);
                        uni.hideLoading()
                        uni.showToast({
                            title: '接口请求失败',
                            icon: 'none'
                        })
                    },
                })
            },
            //删除
            del(item) {
                // console.log(item.hmainid,uni.getStorageSync('HUserName'))
                uni.showModal({
                    title: '提示',
                    content: '确认要删除记录?删除后不能恢复',
                    success: (res) => {
                        if (res.confirm) {
                            console.log('用户点击确定');
                            uni.request({
                                url: this.serverUrl +
                                    '/Sb_EqpRepairWorkBill/DeltetEqpRepairWorkBill',
                                data: {
                                    HInterID: item.hmainid,
                                    user: uni.getStorageSync('HUserName'),
                                },
                                success: (res) => {
                                    console.log(1, res);
                                    if (res.data.count == 1) {
                                        this.clear()
                                    }
                                    uni.showToast({
                                        title: res.data.Message,
                                        icon: 'none'
                                    })
                                },
                                fail: (res) => {
                                    console.log(res);
                                    uni.hideLoading()
                                    uni.showToast({
                                        title: '接口请求失败',
                                        icon: 'none'
                                    })
                                },
                            });
                        } else if (res.cancel) {
                            console.log('用户点击取消');
                        }
                    }
                });
            },
            //撤销
            revoke(item) {
                // console.log(item.hmainid,uni.getStorageSync('HUserName'))
                uni.showModal({
                    title: '提示',
                    content: '是否确认撤销',
                    success: (res) => {
                        if (res.confirm) {
                            console.log('用户点击确定');
                            uni.request({
                                url: this.serverUrl +
                                    '/WEBSController/set_DeleteICStockBillAndWMS_Json',
                                data: {
                                    HInterID: item.HInterID,
                                    HBillNo: item.单据号,
                                    HBillType: this.hform.HBillType,
                                    HMaker: uni.getStorageSync('HUserName'),
                                    MvarReportTitle: this.MvarReportTitle,
                                },
                                success: (res) => {
                                    console.log(1, res);
                                    if (res.data.count == 1) {
                                        this.clear()
                                    }
                                    uni.showToast({
                                        title: res.data.Message,
                                        icon: 'none'
                                    })
                                },
                                fail: (res) => {
                                    console.log(res);
                                    uni.hideLoading()
                                    uni.showToast({
                                        title: '接口请求失败',
                                        icon: 'none'
                                    })
                                },
                            });
                        } else if (res.cancel) {
                            console.log('用户点击取消');
                        }
                    }
                });
            },
        }
    }
</script>
<style lang="scss" scoped>
    @import "@/pages/MJGL/style/MJListStyle.scss"
</style>
pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBillList.vue
@@ -50,26 +50,31 @@
            <view class="list" v-for="(item,index) in showList" :key="index" v-if="tabs==0">
                <uni-card :title="item.制单日期.substr(0,10)" :extra="item.单据号" style="margin: 10px;"
                    @tap="showDetail = showDetail==index?-1:index">
                    <view class="card-detail"
                        v-for="(HBillField, index) in CommonUtils.emptyValueFilter(item,HFieldList).slice(0,10)" :key="index">
                    <view class="card-detail">
                        <template
                            v-if="HBillField.ColmType == 'DateTime'"><text>{{ HBillField.ColmCols }}:</text>{{ item[HBillField.ColmCols] ? dayjs(item[HBillField.ColmCols]).format("YYYY-MM-DD HH:mm:ss") : "" }}
                            v-for="(HBillField, index) in CommonUtils.emptyValueFilter(item,HFieldList).slice(0,10)">
                            <view class="detail" v-if="HBillField.ColmType == 'DateTime'">
                                <text>{{ HBillField.ColmCols }}:</text>{{ item[HBillField.ColmCols] ? dayjs(item[HBillField.ColmCols]).format("YYYY-MM-DD HH:mm:ss") : "" }}
                            </view>
                            <view class="detail" v-else>
                                <text>{{ HBillField.ColmCols }}:</text>{{ item[HBillField.ColmCols] }}
                            </view>
                        </template>
                        <template
                            v-else><text>{{ HBillField.ColmCols }}:</text>{{ item[HBillField.ColmCols] }}</template>
                    </view>
                    <view class="card-detail" v-if="showDetail == index">
                        <view class="card-detail"
                            v-for="(HBillField, index) in CommonUtils.emptyValueFilter(item,HFieldList).slice(10,-1)"
                            :key="index">
                        <view class="card-detail">
                            <template
                                v-if="HBillField.ColmType == 'DateTime'"><text>{{ HBillField.ColmCols }}:</text>{{ item[HBillField.ColmCols] ? dayjs(item[HBillField.ColmCols]).format("YYYY-MM-DD HH:mm:ss") : "" }}
                                v-for="(HBillField, index) in CommonUtils.emptyValueFilter(item,HFieldList).slice(10,-1)">
                                <view class="detail" v-if="HBillField.ColmType == 'DateTime'">
                                    <text>{{ HBillField.ColmCols }}:</text>{{ item[HBillField.ColmCols] ? dayjs(item[HBillField.ColmCols]).format("YYYY-MM-DD HH:mm:ss") : "" }}
                                </view>
                                <view class="detail" v-else>
                                    <text>{{ HBillField.ColmCols }}:</text>{{ item[HBillField.ColmCols] }}</view>
                            </template>
                            <template
                                v-else><text>{{ HBillField.ColmCols }}:</text>{{ item[HBillField.ColmCols] }}</template>
                        </view>
                    </view>
                    <view class="more" v-if="showDetail == index && operations != index">
                        <view class="part" style="border-right: 1px solid #eee;">
                            <uni-icons type="top" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>收起
pages/MJGL/Sc_EquipmentProcessList/Sc_EquipmentProcess.vue
@@ -5,8 +5,8 @@
            height: calcContentHeight + 'px',
            overflowY: 'auto'
        }">
            <view class="list" v-for="(item,index) in showList" :key="index" v-if="tabs==0">
                <uni-card :title="item.单据号" style="margin: 10px;">
            <view class="list" v-for="(item,index) in showList" :key="index" v-if="showList.length>0">
                <uni-card style="margin: 10px;">
                    <view class="card-detail">
                        <template v-for="(field, index)  in CommonUtils.emptyValueFilter(item, HFieldList)">
                            <view v-if="field.ColmType == 'DateTime'" class="detail">
@@ -19,6 +19,7 @@
                    </view>
                </uni-card>
            </view>
            <view class="over" v-if="showList.length == 0">暂无数据</view>
        </view>
        <view class="pagination-zone" id="pagination-zone">
            <uni-pagination show-icon :page-size="size" :total="dataLength" :current="page"
@@ -82,7 +83,7 @@
        },
        onShow() {
            //用户模块权限判断
            this.changeTab(0)
            // this.changeTab(0)
            console.log(this.userInfo, uni.getStorageSync('HUserName'))
        },
        components: {
@@ -133,9 +134,9 @@
                this.page = 1
                this.showList = []
                if (this.tabs == 0) {
                    this.urls = '/Sc_HEquipStateDistribution/Get_EquipICMOTechParamList_Json'
                }
                // if (this.tabs == 0) {
                //     this.urls = '/Sc_HEquipStateDistribution/Get_EquipICMOTechParamList_Json'
                // }
                // if (this.tabs == 1) {
                //     this.urls = '/WEBSController/GetKf_ICStockBillQueryList_User_Json'
                // }
@@ -165,10 +166,10 @@
                        this.dataLength = data.length
                        this.HFieldList = CommonUtils.fieldListFilterRole({
                            FieldList: list,
                            ExcludeKeys: ["单据号"]
                            ExcludeKeys: []
                        }).data
                        console.log('this.HFieldList: ', this.HFieldList);
                        console.log('showList: ', this.showList);
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
@@ -205,12 +206,12 @@
                HICMOInterID,
                HICMOEntryID
            } = e
            if (operationType == 4) {
                this.HInterID = HEquipID
                this.HICMOInterID = HICMOInterID
                this.HICMOEntryID = HICMOEntryID
                this.hform.HInterID = HEquipID
                this.hform.HICMOInterID = HICMOInterID
                this.hform.HICMOEntryID = HICMOEntryID
            }
            this.changeTab(0)
        }
    }
</script>
pages/MJGL/Sc_OEEStatusReport/Sc_OEEStatusReport.vue
New file
@@ -0,0 +1,313 @@
<template>
    <view>
        <view class="tabs" id="tabs">
            <view :class="tabs == 0 ? 'on':''" @tap="switchTab(0)">待维修</view>
            <view :class="tabs == 1 ? 'on':''" @tap="switchTab(1)">已维修</view>
            <!-- <view :class="tabs == 2 ? 'on':''" @tap="switchTab(2)">全部任务</view> -->
        </view>
        <!-- 设备维修任务列表列表 -->
        <view v-show="tabs == 0">
            <view class="list" v-for="(item,index) in reportBillsDisplay" :key="index">
                <uni-card :title="item.故障登记单号" :extra="`日期: ${dayjs(item.设备故障日期).format('YYYY-MM-DD')}`"
                    style="margin: 10px;">
                    <view class="card-detail">
                        <view class="detail" v-for="(field, index) in CommonUtils.emptyValueFilter(item, HFieldList)"
                            :key="index">
                            <text>{{field.ColmCols}}:</text>{{item[field.ColmCols]}}
                        </view>
                    </view>
                </uni-card>
            </view>
            <view class="over" v-if="reportBillsDisplay.length == 0">暂无数据</view>
        </view>
        <!-- OEE 折线图 -->
        <view v-show="tabs == 1" style="padding: 40rpx 0;">
            <view style="width:750rpx; height:750rpx"><l-echart ref="chartRef" @finished="initChart()"></l-echart>
            </view>
        </view>
    </view>
</template>
<script>
    import {
        getUserInfo
    } from '../../../utils/auth';
    import {
        CommonUtils
    } from '../../../utils/common';
    import dayjs from 'dayjs';
    import * as echarts from 'echarts'
    export default {
        // 设备状态 模块
        name: 'Sc_OEEStatusReport',
        data() {
            return {
                dayjs,
                CommonUtils,
                tabs: 0,
                HEquipID: 0,
                HEquipNumber: "",
                reportBillsDisplay: [],
                reportBills: [], // 待维修
                HFieldList: [], // 字段列表
            }
        },
        methods: {
            switchTab(tabIndex) {
                this.tabs = tabIndex
                switch (tabIndex) {
                    case 0:
                        this.reportBillsDisplay = this.reportBills;
                        break;
                        // case 1:
                        //     this.reportBillsDisplay = this.reportBillsRepaired;
                        //     break;
                        // case 2:
                        //     this.reportBillsDisplay = this.reportBillsAll;
                        //     break;
                }
            },
            async getEquipFileMain(HInterID) {
                try {
                    let res = await CommonUtils.doRequest2Sync({
                        url: "/Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_ListByHEquipID",
                        data: {
                            HEquipID: HInterID,
                        },
                    })
                    if (!res) {
                        return
                    }
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        console.log('data: ', data);
                        // this.hform.HQty = 1
                        this.HEquipID = data[0]["hmainid"]
                        this.HEquipNumber = data[0]["设备编码"]
                        this.enableEdit = false
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: err
                    })
                }
            },
            async getReportList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: '/Sc_OEEReport/list',
                        data: {
                            sWhere: `4,'${this.HEquipNumber}','','','','${dayjs(new Date()).subtract(2, 'weeks').format("YYYY-MM-DD")}', '${dayjs(new Date()).format("YYYY-MM-DD")}'`,
                            user: getUserInfo()["Czymc"]
                        }
                    })
                    let {
                        count,
                        data,
                        Message,
                        list
                    } = res.data
                    if (count == 1) {
                        // console.log('data: ', data);
                        this.reportBills = data
                        let fieldList = CommonUtils.fieldListFilterRole({
                            ExcludeKeys: ['设备编码'],
                            FieldList: list
                        })
                        if (fieldList.status == false) {
                            CommonUtils.showTips({
                                title: '温馨提示',
                                message: `获取表单结构失败: ${fieldList.Message}`
                            })
                        }
                        this.HFieldList = fieldList.data
                        this.switchTab(0)
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: `获取设备OEE异常: ${Message}`
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: `获取维修单异常: ${err}`
                    })
                }
            },
            async initChart() {
                let option_ZZT1 = {}
                var H_X1 = []; //X轴标题
                var HOEE = []; //设备OEE
                var PerformanceUtilizationRate = []; //性能稼动率
                var TimeUtilizationRate = []; //时间稼动率
                var HTitle = "设备OEE"; //图形标题
                if (this.reportBills.length > 0) {
                    for (let i = 0; i < this.reportBills.length; i++) {
                        H_X1.push(this.reportBills[i].日期);
                    }
                    // 填充数据
                    for (let i = 0; i < this.reportBills.length; i++) {
                        HOEE.push((this.reportBills[i].OEE).replace('%', ''));
                        PerformanceUtilizationRate.push((this.reportBills[i].性能稼动率).replace('%', ''));
                        TimeUtilizationRate.push((this.reportBills[i].时间稼动率).replace('%', ''));
                    }
                }
                option_ZZT1 = {
                    title: {
                        text: HTitle,
                        left: 'center'
                    },
                    tooltip: {
                        trigger: 'axis',
                        formatter: function(params) {
                            let tooltipHtml = params[0].axisValue + '<br>'; // X轴数值
                            params.forEach(function(item) {
                                let valueToShow = parseFloat(item.value); // 将字符串转换为数值
                                tooltipHtml += item.seriesName + ': ' + valueToShow.toFixed(3) +
                                    '%' + '<br>'; // Y轴数值,并添加百分号
                            });
                            return tooltipHtml;
                        }
                    },
                    legend: {
                        data: ['OEE', '性能稼动率', '时间稼动率'],
                        top: 'bottom',
                        left: 'center'
                    },
                    toolbox: {
                        show: false,
                        orient: 'vertical',
                        left: 'right',
                        top: 'center',
                        feature: {
                            mark: {
                                show: true
                            },
                            dataView: {
                                show: true,
                                readOnly: false
                            },
                            magicType: {
                                show: true,
                                type: ['line', 'bar', 'stack']
                            },
                            restore: {
                                show: true
                            },
                            saveAsImage: {
                                show: true
                            }
                        }
                    },
                    xAxis: [{
                        type: 'category',
                        axisTick: {
                            show: false
                        },
                        data: H_X1
                    }],
                    yAxis: [{
                        type: 'value',
                        axisLabel: {
                            formatter: '{value} %'
                        }
                    }],
                    series: [{
                            name: 'OEE',
                            type: 'line',
                            label: {
                                show: true,
                                formatter: '{c}%'
                            },
                            itemStyle: {
                                normal: {
                                    lineStyle: {
                                        color: '#00FF00' // 设置线条颜色为绿色
                                    },
                                    color: '#00FF00' // 设置线条颜色为绿色
                                }
                            },
                            data: HOEE
                        },
                        {
                            name: '性能稼动率',
                            type: 'line',
                            label: {
                                show: true,
                                formatter: '{c}%'
                            },
                            itemStyle: {
                                normal: {
                                    lineStyle: {
                                        color: '#FF0000' // 设置线条颜色为红色‌
                                    },
                                    color: '#FF0000' // 设置线条颜色为红色
                                }
                            },
                            data: PerformanceUtilizationRate
                        },
                        {
                            name: '时间稼动率',
                            type: 'line',
                            label: {
                                show: true,
                                formatter: '{c}%'
                            },
                            itemStyle: {
                                normal: {
                                    lineStyle: {
                                        color: '#00FFFF' // 设置线条颜色为青色
                                    },
                                    color: '#00FFFF' // 设置线条颜色为青色
                                }
                            },
                            data: TimeUtilizationRate
                        }
                    ]
                };
                // chart 图表实例不能存在data里
                const chart = await this.$refs.chartRef.init(echarts);
                chart.setOption(option_ZZT1)
            }
        },
        async onLoad(e) {
            if (e.HEquipID) {
                await this.getEquipFileMain(e.HEquipID)
                await this.$nextTick()
                await this.getReportList()
                await this.initChart()
            }
        }
    }
</script>
<style lang="scss">
    @import "@/pages/MJGL/style/MJBillStyle.scss"
</style>
pages/index/tab2.vue
@@ -423,7 +423,7 @@
                    {
                        "img": "../../static/icon/icon7.png",
                        "text": "设备维修记录单列表",
                        "url": "/pages/shebeiweixiu/SbEqpMaintenanceBillList",
                        "url": "/pages/MJGL/Sb_EqpMaintenance/Sb_EqpMaintenanceBillList",
                        "id": 52,
                        "hidden": false
                    },
pages/index/tab3.vue
@@ -61,6 +61,13 @@
                    },
                    {
                        img: '../../static/icon/icon8.png',
                        text: '模具档案查询',
                        url: `/pages/MJGL/Gy_MouldFile/Gy_MouldFileList`,
                        id: 2,
                        hidden: false,
                    },
                    {
                        img: '../../static/icon/icon16.png',
                        text: '器具寿命',
                        url: '/pages/shoujishouming/table',
@@ -72,6 +79,13 @@
                        "text": "器具故障登记单",
                        "url": "/pages/MJGL/Sc_MouldConkBookBill/Sc_MouldConkBookBill?operationType=1",
                        "id": 4,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon6.png",
                        "text": "设备故障登记单",
                        "url": "/pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBill?operationType=1",
                        "id": 20,
                        "hidden": false
                    },
                    {
@@ -182,9 +196,9 @@
                        "id": 19,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "设备故障登记单",
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "设备故障登记单",
                        "url": "/pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBill?operationType=1",
                        "id": 20,
                        "hidden": false
@@ -196,20 +210,12 @@
                        "id": 21,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "设备维修记录单",
                        "url": "/pages/MJGL/Sb_EquipRepairCheckBill/Sb_EquipRepairCheckBill",
                        "id": 23,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "设备维修验收单",
                        "url": "/pages/MJGL/Sb_EquipRepairCheckBill/Sb_EquipRepairCheckBill",
                        "id": 23,
                        "hidden": false
                    },
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "设备保养任务",
@@ -240,8 +246,9 @@
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "设备状态查询",
                        "url": "/pages/shebeiyunxingzhuangtai/shebeiyunxingzhuangtai",
                        "text": "设备维修记录单",
                        "url": "/pages/MJGL/Sb_EqpMaintenance/Sb_EqpMaintenanceBill",
                        "id": 28,
                        "hidden": false
                    }
pages/shebeiyunxingzhuangtai/detail.vue
@@ -12,10 +12,10 @@
            <button size="mini" data-type="equipStop" plain>停机</button>
            <button size="mini" data-type="workDotCheck" plain>点检记录</button>
            <button size="mini" data-type="equipConkBook" plain>故障登记</button>
            <button size="mini" plain>维修</button>
            <button size="mini" data-type="eqpMaintenance" plain>维修</button>
            <button size="mini" data-type="equipResume" plain>履历</button>
            <button size="mini" data-type="equipmentProcess" plain>工艺</button>
            <button size="mini" plain>状态</button>
            <button size="mini" data-type="OEEStatusReport" plain>状态</button>
        </view>
    </view>
@@ -107,7 +107,6 @@
                        data: [], // 默认series数据为空
                        type: 'bar'
                    }],
                    animation: false
                };
                // 如果有数据,更新option的内容
@@ -198,7 +197,6 @@
                        data: [], // 默认series数据为空
                        type: 'bar'
                    }],
                    animation: false
                };
@@ -253,7 +251,6 @@
                        },
                        series: [], // 清空数据
                        graphic: [], // 清空图形中的文本
                        animation: false
                    });
                } else {
                    // 状态颜色映射
@@ -390,7 +387,6 @@
                        data: [], // 默认series数据为空
                        type: 'bar'
                    }],
                    animation: false
                };
                // 如果有数据,更新option的内容
@@ -425,7 +421,7 @@
                // 更新图表
                mychart4.setOption(option);
            },
            initCharts(data) {
            async initCharts(data) {
                try {
                    let {
                        h_p_Sc_FourStateDistributionReport,
@@ -435,10 +431,10 @@
                    } = data
                    // 能显示暂无数据,但是需要渲染两次图表
                    this.initHistogram1 = this.initHistogram1(h_p_Sc_FourStateDistributionReport);
                    this.initLineChart = this.initLineChart(h_p_Sc_FourStateDistributionReport1);
                    this.initStatistics = this.initStatistics(h_p_Sc_FourStateDistributionReport2);
                    this.initHistogram4 = this.initHistogram4(h_p_Sc_FourStateDistributionReport3);
                    this.initHistogram1 = await this.initHistogram1(h_p_Sc_FourStateDistributionReport);
                    this.initLineChart = await this.initLineChart(h_p_Sc_FourStateDistributionReport1);
                    this.initStatistics = await this.initStatistics(h_p_Sc_FourStateDistributionReport2);
                    this.initHistogram4 = await this.initHistogram4(h_p_Sc_FourStateDistributionReport3);
                } catch (e) {
                    console.error(e)
                }
@@ -476,36 +472,52 @@
                                url: "/pages/MJGL/Sb_EquipStop/Sb_EquipStopBill?HEquipID=" + this.HEquipID
                            });
                            break;
                        case "workDotCheck":
                        case "workDotCheck":
                            // 导航到点检记录
                            uni.navigateTo({
                                url: "/pages/MJGL/Sc_WorkDotCheck/Sc_WorkDotCheckBillList_Day?operationType=设备&HEquipID=" + this.HEquipID
                            });
                            ;break;
                        case "equipConkBook":
                                url: "/pages/MJGL/Sc_WorkDotCheck/Sc_WorkDotCheckBillList_Day?operationType=设备&HEquipID=" +
                                    this.HEquipID
                            });;
                            break;
                        case "equipConkBook":
                            // 导航到设备故障登记单
                            uni.navigateTo({
                                url: "/pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBill?operationType=4&HEquipID=" + this.HEquipID
                            })
                        ;break;
                                url: "/pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBill?operationType=4&HEquipID=" +
                                    this.HEquipID
                            });
                            break;
                        case "equipResume":
                            // 导航到设备履历
                            uni.navigateTo({
                                url: "/pages/MJGL/Sb_EquipResumeCheckQuery/Sb_EquipResumeCheckQuery?operationType=4&HEquipID=" + this.HEquipID
                            })
                        ;break;
                        case "equipmentProcess":
                                url: "/pages/MJGL/Sb_EquipResumeCheckQuery/Sb_EquipResumeCheckQuery?operationType=4&HEquipID=" +
                                    this.HEquipID
                            });
                            break;
                        case "equipmentProcess":
                            // 导航到设备工艺
                            if(!this.HICMOInterID && !this.HICMOEntryID) {
                            if (!this.HICMOInterID && !this.HICMOEntryID) {
                                CommonUtils.showTips({
                                    message: "当前设备无生产订单,无法查看工艺"
                                })
                            }
                            uni.navigateTo({
                                url: "/pages/MJGL/Sc_EquipmentProcessList/Sc_EquipmentProcess?operationType=4&HEquipID=" + this.HEquipID
                                + `&HICMOInterID=${this.HICMOInterID}&HICMOEntryID=${this.HICMOEntryID}`
                            })
                        ;break;
                                url: "/pages/MJGL/Sc_EquipmentProcessList/Sc_EquipmentProcess?operationType=4&HEquipID=" +
                                    this.HEquipID +
                                    `&HICMOInterID=${this.HICMOInterID}&HICMOEntryID=${this.HICMOEntryID}`
                            });
                            break;
                        case "eqpMaintenance":
                            uni.navigateTo({
                                url: "/pages/MJGL/Sb_EqpMaintenance/Sb_EqpMaintenanceBill?operationType=4&HEquipID=" +
                                    this.HEquipID
                            });
                            break;
                        case "OEEStatusReport":
                            uni.navigateTo({
                                url: "/pages/MJGL/Sc_OEEStatusReport/Sc_OEEStatusReport?operationType=4&HEquipID=" +
                                    this.HEquipID
                            });
                            break;
                        default:
                            return;
                    }
@@ -526,7 +538,7 @@
                    })
                    let res1 = res.data
                    this.initCharts(res1.data)
                    await this.initCharts(res1.data)
                } catch (err) {
                    uni.showToast({
                        icon: "fail",
@@ -535,7 +547,7 @@
                }
            }
        },
        onLoad(options) {
        async onLoad(options) {
            let {
                HDeptID,
                HSourceID,
@@ -547,7 +559,7 @@
            this.HICMOInterID = HICMOInterID
            this.HICMOEntryID = HICMOEntryID
            this.getDiagram(HDeptID, HSourceID)
            await this.getDiagram(HDeptID, HSourceID)
        },
    }
</script>