zrg
10 天以前 52663e888fff7f234729199ee7be9b425ba1138d
优化设备故障维修全流程页面与功能
5个文件已修改
2233 ■■■■ 已修改文件
components/BillListPopup/BillListPopupEquipConkBookBill.vue 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/Sb_EqpMaintenance/Sb_EqpMaintenanceBill.vue 2056 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBill.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/Sb_EquipRepairCheckBill/Sb_EquipRepairCheckBill.vue 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBill.vue 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/BillListPopup/BillListPopupEquipConkBookBill.vue
@@ -137,9 +137,12 @@
            },
            MultiSourceBill: {
                type: Boolean,
                default: false,
                required: false
            }
                default: false
            },
            HEquipID: {
                type: Number,
                default: 0
            } // 新增设备ID
        },
        model: {
            prop: "HSourceBill",
@@ -247,12 +250,15 @@
                if (this.HBillNo) {
                    sWhere += ` and 单据号 like '%${this.HBillNo}%'`
                }
                if (this.HSourceBillType === '设备维修记录单') {
                    sWhere += ` and isnull(维修人,'')!='${uni.getStorageSync('HUserName')}$'  `
                if (this.HEquipID && this.HEquipID > 0) {
                    sWhere += ` and HEquipID = ${this.HEquipID}`
                }
                sWhere += ` and isnull(关闭人,'')!=''  `
                if (this.HSourceBillType === '设备维修记录单') {
                    sWhere += ` and isnull(维修人,'')!='${uni.getStorageSync('HUserName')}'  `
                }
                sWhere += ` and isnull(关闭人,'')=''  `
                return sWhere
            },
            getBillList() {
@@ -284,16 +290,17 @@
                            Message
                        } = res.data
                        if (count == 1) {
                            this.length = Array.from(data).length
                            data = data || []; // ✅ 关键:若 data 为 null,替换成空数组
                            this.length = data.length;
                            const result = [];
                            for (let i = 0; i < data.length; i += this.size) {
                                result.push(data.slice(i, i + this.size));
                            }
                            this.HBillList = result
                            this.page = result.length
                            this.HBillList = result;
                            this.page = result.length;
                            setTimeout(() => {
                                this.enablefocus = true
                            }, 500)
                                this.enablefocus = true;
                            }, 500);
                        } else {
                            setTimeout(() => {
                                this.enablefocus = true
pages/MJGL/Sb_EqpMaintenance/Sb_EqpMaintenanceBill.vue
@@ -1,1084 +1,1102 @@
<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="{
    <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>
                    <view class="right" v-show="showHMainSourceBillType">
                        <picker :range="arrayHMainSourceBillType" @change="HMainSourceBillTypeChange">
                <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="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>
                    <view class="right" v-show="showHMainSourceBillType">
                        <picker :range="arrayHMainSourceBillType" @change="HMainSourceBillTypeChange">
                            <input disabled name="HMainSourceBillType" v-model="HMainSourceBillType"
                                placeholder="请选择源单类型" />
                            <view class="picker-overlay"></view>
                        </picker>
                    </view>
                    <view class="righton" v-show="!showHMainSourceBillType">
                        <input name="HMainSourceBillType" disabled v-model="HMainSourceBillType"
                            placeholder="请选择源单类型" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">源单单号:</view>
                    <view :class="enableSourceBillEdit?'right':'righton'">
                        <input v-model="hform.HMainSourceBillNo" :disabled="!enableSourceBillEdit"
                            @confirm="GetMessageByHMainSourceBillNo(hform.HMainSourceBillNo)"
                            placeholder="请输入(或扫描)源单单号" />
                    </view>
                    <view class="icon-wrapper" v-show="hform.HMainSourceBillType != '手工录入'">
                        <uni-icons :disabled="hform.HMainSourceBillType == '手工录入'" type="search" size="20"
                            @click="showBillList"></uni-icons>
                    </view>
                    <view class="icon-wrapper" v-show="hform.HMainSourceBillType != '手工录入'">
                        <uni-icons :disabled="hform.HMainSourceBillType == '手工录入'" type="scan" size="20"
                            @click="toScanHMainSourceBillNo"></uni-icons>
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">时间单位:</view>
                    <zxz-uni-data-select class="right" :localdata="[
                            <input disabled name="HMainSourceBillType" v-model="HMainSourceBillType"
                                placeholder="请选择源单类型" />
                            <view class="picker-overlay"></view>
                        </picker>
                    </view>
                    <view class="righton" v-show="!showHMainSourceBillType">
                        <input name="HMainSourceBillType" disabled v-model="HMainSourceBillType"
                            placeholder="请选择源单类型" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">源单单号:</view>
                    <view :class="enableSourceBillEdit?'right':'righton'">
                        <input v-model="hform.HMainSourceBillNo" :disabled="!enableSourceBillEdit"
                            @confirm="GetMessageByHMainSourceBillNo(hform.HMainSourceBillNo)"
                            placeholder="请输入(或扫描)源单单号" />
                    </view>
                    <view class="icon-wrapper" v-show="hform.HMainSourceBillType != '手工录入'">
                        <uni-icons :disabled="hform.HMainSourceBillType == '手工录入'" type="search" size="20"
                            @click="showBillList"></uni-icons>
                    </view>
                    <view class="icon-wrapper" v-show="hform.HMainSourceBillType != '手工录入'">
                        <uni-icons :disabled="hform.HMainSourceBillType == '手工录入'" type="scan" size="20"
                            @click="toScanHMainSourceBillNo"></uni-icons>
                    </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>
                </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>
                </view>
                <view class="form-item">
                    <view class="title">维修项目:</view>
                    <zxz-uni-data-select required class="right" :localdata="HRepairList" dataKey="维修项目"
                        dataValue="hitemid" v-model="hform.HRepairID" filterable>
                    </zxz-uni-data-select>
                </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>
                </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 class="form-item">
                    <view class="title">维修要求:</view>
                    <view class="right">
                        <textarea v-model="hform.HExplanation" placeholder="请输入维修要求" />
                    </view>
                </view>
            </view>
        </template>
                    </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>
                </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>
                </view>
        <!-- 其他信息 -->
        <template v-if="tabs == 2">
            <view class="form" :style="{
                <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>
                </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" filterable>
                    </zxz-uni-data-select>
                </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>
                    <view class="right">
                        <textarea v-model="hform.HRepairContent" placeholder="请输入维修内容" />
                    </view>
                </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 class="form-item">
                    <view class="title">备注:</view>
                    <view class="right">
                        <textarea v-model="hform.HRemark" placeholder="请输入备注" />
                    </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>
                <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> -->
        <!-- 源单单据列表弹窗 -->
        <BillListPopupEquipConkBookBillVue ref="billList" :HBillType="hform.HBillType"
            :HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID">
        </BillListPopupEquipConkBookBillVue>
    </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> -->
        <!-- 源单单据列表弹窗 -->
        <BillListPopupEquipConkBookBillVue ref="billList" :HBillType="hform.HBillType" :HEquipID="hform.HEquipID"
            :HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID">
        </BillListPopupEquipConkBookBillVue>
    </view>
</template>
<script>
    import dayjs from "dayjs";
    import {
        CommonUtils
    } from "@/utils/common";
    import {
        MpaasScan
    } from "@/utils/mpaasScan.js"
    import {
        getUserInfo
    } from "../../../utils/auth";
    // 引入源单单据列表弹窗组件
    import BillListPopupEquipConkBookBillVue from '../../../components/BillListPopup/BillListPopupEquipConkBookBill.vue';
    import dayjs from "dayjs";
    import {
        CommonUtils
    } from "@/utils/common";
    import {
        MpaasScan
    } from "@/utils/mpaasScan.js"
    import {
        getUserInfo
    } from "../../../utils/auth";
    // 引入源单单据列表弹窗组件
    import BillListPopupEquipConkBookBillVue from '../../../components/BillListPopup/BillListPopupEquipConkBookBill.vue';
    export default {
        // 设备维修记录单
        name: 'Sb_EqpMaintenanceBill',
        components: {
            BillListPopupEquipConkBookBillVue
        },
        data() {
            return {
                tabs: 0,
    export default {
        // 设备维修记录单
        name: 'Sb_EqpMaintenanceBill',
        components: {
            BillListPopupEquipConkBookBillVue
        },
        data() {
            return {
                tabs: 0,
                btnTop: 0,
                tabsBottom: 0,
                HModName: "Sb_EqpMaintenanceBill",
                HBillType: '3910',
                operationType: 1,
                uploadOptions: {},
                enableEdit: true,
                enableSourceBillEdit: false,
                btnTop: 0,
                tabsBottom: 0,
                HModName: "Sb_EqpMaintenanceBill",
                HBillType: '3910',
                operationType: 1,
                uploadOptions: {},
                enableEdit: true,
                enableSourceBillEdit: false,
                // 源单类型相关
                HMainSourceBillType: "手工录入", // 用于显示的源单类型
                arrayHMainSourceBillType: ['设备维修登记单', '手工录入', '设备维修派工单'],
                arrayHMainSourceBillTypeID: ['设备维修登记单', '手工录入', '设备维修派工单'], // 对应的单据类型ID
                showHMainSourceBillType: true,
                // 源单类型相关
                HMainSourceBillType: "设备维修登记单", // 用于显示的源单类型
                arrayHMainSourceBillType: ['设备维修登记单', '手工录入', '设备维修派工单'],
                arrayHMainSourceBillTypeID: ['设备维修登记单', '手工录入', '设备维修派工单'], // 对应的单据类型ID
                showHMainSourceBillType: true,
                HDeptList: [],
                HRepairCheckList: [],
                HEmpList: [],
                HRepairList: [],
                HDeptList: [],
                HRepairCheckList: [],
                HEmpList: [],
                HRepairList: [],
                hform: {
                    HBillType: '3910',
                    HStockOrgID: uni.getStorageSync("OrganizationID"),
                    HBarCode: "",
                    HBarCode: '',
                    HRepairBeginDate: dayjs(new Date()).format("YYYY-MM-DD"),
                    HRepairEndDate: dayjs(new Date()).format("YYYY-MM-DD"),
                    HRepairContent: '',
                    HBillNo: '',
                    HInterID: 0,
                    HDate: dayjs(new Date()).format("YYYY-MM-DD"),
                    HDeptName: getUserInfo().HDeptName,
                    HDeptID: getUserInfo().HDeptID,
                    HEmpName: getUserInfo().HEmpName,
                    HEmpID: getUserInfo().HEmpID,
                    HRepair: '',
                    HRepairID: 0,
                    HExplanation: '',
                    HMainSourceBillType: '设备维修登记单', // 默认为设备维修登记单
                    HMainSourceBillNo: '',
                    HMainSourceInterID: 0,
                    HMainSourceEntryID: 0,
                    HManagerName: getUserInfo().HManagerName,
                    HManagerID: getUserInfo().HManagerID,
                    HTimes: 0,
                    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: {
            // 显示源单单据列表弹窗
            showBillList() {
                this.$refs.billList.showPopup()
            },
                hform: {
                    HBillType: '3910',
                    HStockOrgID: uni.getStorageSync("OrganizationID"),
                    HBarCode: "",
                    HBarCode: '',
                    HRepairBeginDate: dayjs(new Date()).format("YYYY-MM-DD"),
                    HRepairEndDate: dayjs(new Date()).format("YYYY-MM-DD"),
                    HRepairContent: '',
                    HBillNo: '',
                    HInterID: 0,
                    HDate: dayjs(new Date()).format("YYYY-MM-DD"),
                    HDeptName: getUserInfo().HDeptName,
                    HDeptID: getUserInfo().HDeptID,
                    HEmpName: getUserInfo().HEmpName,
                    HEmpID: getUserInfo().HEmpID,
                    HRepair: '',
                    HRepairID: 0,
                    HExplanation: '',
                    HMainSourceBillType: '设备维修登记单', // 默认为设备维修登记单
                    HMainSourceBillNo: '',
                    HMainSourceInterID: 0,
                    HMainSourceEntryID: 0,
                    HManagerName: getUserInfo().HManagerName,
                    HManagerID: getUserInfo().HManagerID,
                    HTimes: 0,
                    HCycleUnit: '小时',
                    HBarName: '',
                    HNumber: '',
                    HEquipID: 0,
                    HBarSpec: '',
                    HBarModel: '',
                    HRemark: '',
                    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: {
            // 显示源单单据列表弹窗
            showBillList() {
                this.$refs.billList.showPopup()
            },
            // 选择源单类型
            HMainSourceBillTypeChange(e) {
                if (e.detail.value == -1 || e.detail.value == NaN) {
                    this.HMainSourceBillType = '手工录入'
                    this.hform.HMainSourceBillType = '手工录入'
                    this.enableSourceBillEdit = false
                    return
                }
            // 选择源单类型
            HMainSourceBillTypeChange(e) {
                if (e.detail.value == -1 || e.detail.value == NaN) {
                    this.HMainSourceBillType = '手工录入'
                    this.hform.HMainSourceBillType = '手工录入'
                    this.enableSourceBillEdit = false
                    return
                }
                if (e.detail.value == 1) {
                    this.enableSourceBillEdit = false
                } else {
                    this.enableSourceBillEdit = true
                }
                if (e.detail.value == 1) {
                    this.enableSourceBillEdit = false
                } else {
                    this.enableSourceBillEdit = true
                }
                this.HMainSourceBillType = this.arrayHMainSourceBillType[e.detail.value]
                this.hform.HMainSourceBillType = this.arrayHMainSourceBillTypeID[e.detail.value]
                this.HMainSourceBillType = this.arrayHMainSourceBillType[e.detail.value]
                this.hform.HMainSourceBillType = this.arrayHMainSourceBillTypeID[e.detail.value]
                // 缓存当前页面选择
                const pages = getCurrentPages()
                const currentPage = pages[pages.length - 1]
                uni.setStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`, {
                    HSourceBillTypeName: this.HMainSourceBillType,
                    HSourceBillType: this.hform.HMainSourceBillType
                })
                this.updateEnableSourceBillEdit();
            },
            updateEnableSourceBillEdit() {
                this.enableSourceBillEdit = this.hform.HMainSourceBillType !== '手工录入';
            },
            // 读取缓存
            loadCache() {
                const pages = getCurrentPages()
                const currentPage = pages[pages.length - 1]
                let HBillTypeCache = uni.getStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`)
                if (HBillTypeCache) {
                    this.HMainSourceBillType = HBillTypeCache.HSourceBillTypeName
                    this.hform.HMainSourceBillType = HBillTypeCache.HSourceBillType
                }
            },
                // 缓存当前页面选择
                const pages = getCurrentPages()
                const currentPage = pages[pages.length - 1]
                uni.setStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`, {
                    HSourceBillTypeName: this.HMainSourceBillType,
                    HSourceBillType: this.hform.HMainSourceBillType
                })
            },
            // 维修项目
            async getRepairList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: '/Gy_Repair/GetRepairList',
                        data: {
                            sWhere: '',
                            user: getUserInfo()["Czymc"]
                        }
                    })
            // 读取缓存
            loadCache() {
                const pages = getCurrentPages()
                const currentPage = pages[pages.length - 1]
                let HBillTypeCache = uni.getStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`)
                if (HBillTypeCache) {
                    this.HMainSourceBillType = HBillTypeCache.HSourceBillTypeName
                    this.hform.HMainSourceBillType = HBillTypeCache.HSourceBillType
                }
            },
                    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) {
            // 维修项目
            async getRepairList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: '/Gy_Repair/GetRepairList',
                        data: {
                            sWhere: '',
                            user: getUserInfo()["Czymc"]
                        }
                    })
            },
            // 提交数据有效性校验
            ValidCheck() {
                if (this.hform.HEquipID == 0 || this.hform.HEquipID === undefined) {
                    return {
                        Message: "未录入设备信息,请先录入设备信息!",
                        state: false
                    }
                }
                if (this.hform.HDeptID == 0 || this.hform.HDeptID === undefined) {
                    return {
                        Message: "部门不得为空!",
                        state: false
                    }
                }
                if (this.hform.HEmpID == 0 || this.hform.HEmpID === undefined) {
                    return {
                        Message: "维修人不得为空!",
                        state: false
                    }
                }
                if (this.hform.HManagerID == 0 || this.hform.HManagerID === undefined) {
                    return {
                        Message: "负责人不得为空!",
                        state: false
                    }
                }
                if (this.hform.HRepairID == 0 || this.hform.HRepairID === undefined) {
                    return {
                        Message: "维修项目不得为空!",
                        state: false
                    }
                }
                if (this.hform.HMainSourceBillType !== '手工录入') {
                    if (!this.hform.HMainSourceBillNo || this.hform.HMainSourceBillNo.trim() === '') {
                        CommonUtils.showTips({
                            message: '源单类型非手工录入,必须选择源单!'
                        })
                        return
                    }
                }
                return {
                    Message: "",
                    state: true
                }
            },
            addNew() {
                uni.redirectTo({
                    url: './Sb_EqpMaintenanceBill?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)
                        }
                    },
                })
                    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) {
            },
            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: "",
                        }
                    })
            },
            // 提交数据有效性校验
            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
                    }
                }
                if (this.hform.HMainSourceBillType !== '手工录入') {
                    if (!this.hform.HMainSourceBillNo || this.hform.HMainSourceBillNo.trim() === '') {
                        CommonUtils.showTips({
                            message: '源单类型非手工录入,必须选择源单!'
                        })
                        return
                    }
                }
                return {
                    Message: "",
                    state: true
                }
            },
            addNew() {
                uni.redirectTo({
                    url: './Sb_EqpMaintenanceBill?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)
                        }
                    },
                })
                    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')
                        }
                    })
            },
            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.HDeptList = data
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: err
                    })
                }
            },
            // 获取职员数据
            async getEmpList() {
                let sWhere = " where 1=1 "
                if (this.hform.HDeptName && uni.getStorageSync("Organization") == '宁波市华舟包装有限公司') {
                    sWhere += ` and HDeptName = '${this.hform.HDeptName}'`
                }
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: '/PublicPageMethod/UserList',
                        data: {
                            sWhere: sWhere
                        }
                    })
                    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.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.HDeptList = data
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: err
                    })
                }
            },
            // 获取职员数据
            async getEmpList() {
                let sWhere = " where 1=1 "
                if (this.hform.HDeptName && uni.getStorageSync("Organization") == '宁波市华舟包装有限公司') {
                    sWhere += ` and HDeptName = '${this.hform.HDeptName}'`
                }
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: '/PublicPageMethod/UserList',
                        data: {
                            sWhere: sWhere
                        }
                    })
                    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.hform.HBarCode = cb
                    this.GetMessageByBarCode(cb)
                })
            },
            toScanHMainSourceBillNo() {
                MpaasScan.scanCode(cb => {
                    this.hfrom.HMainSourceBillNo = cb
                    this.GetMessageByHMainSourceBillNo(cb)
                })
            },
            async GetMessageByHMainSourceBillNo(HSouceBillNo) {
                try {
                    let url = ''
                    let dataField = ''
                    // 根据源单类型选择不同的接口
                    if (this.hform.HMainSourceBillType === '设备维修登记单') {
                        url = "/Sb_EqpRepairWorkBill/GetEqpConkBookBillListPage";
                        dataField = {
                            sWhere: ` and 单据号 = '${HSouceBillNo}'`,
                            user: getUserInfo()["Czymc"],
                            page: 1,
                            size: 1,
                        };
                    } else if (this.hform.HMainSourceBillType === '设备维修派工单') {
                        url = "/Sb_EquipRepairSendWorkBill/GetEquipRepairSendWorkBillListPage";
                        dataField = {
                            sWhere: ` and 单据号 = '${HSouceBillNo}'`,
                            user: getUserInfo()["Czymc"],
                            page: 1,
                            size: 1,
                        };
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `暂不支持该源单类型:${this.hform.HMainSourceBillType}`
                        })
                        return;
                    }
                    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 res = await CommonUtils.doRequest2Async({
                        url: url,
                        data: dataField
                    })
                    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.hform.HBarCode = cb
                    this.GetMessageByBarCode(cb)
                })
            },
            toScanHMainSourceBillNo() {
                MpaasScan.scanCode(cb => {
                    this.hfrom.HMainSourceBillNo = cb
                    this.GetMessageByHMainSourceBillNo(cb)
                })
            },
            async GetMessageByHMainSourceBillNo(HSouceBillNo) {
                try {
                    let url = ''
                    let dataField = ''
                    // 根据源单类型选择不同的接口
                    if (this.hform.HMainSourceBillType === '设备维修登记单') {
                        url = "/Sb_EqpRepairWorkBill/GetEqpConkBookBillListPage";
                        dataField = {
                            sWhere: ` and 单据号 = '${HSouceBillNo}'`,
                            user: getUserInfo()["Czymc"],
                            page: 1,
                            size: 1,
                        };
                    } else if (this.hform.HMainSourceBillType === '设备维修派工单') {
                        url = "/Sb_EquipRepairSendWorkBill/GetEquipRepairSendWorkBillListPage";
                        dataField = {
                            sWhere: ` and 单据号 = '${HSouceBillNo}'`,
                            user: getUserInfo()["Czymc"],
                            page: 1,
                            size: 1,
                        };
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `暂不支持该源单类型:${this.hform.HMainSourceBillType}`
                        })
                        return;
                    }
                    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"]
                    let res = await CommonUtils.doRequest2Async({
                        url: url,
                        data: dataField
                    })
                    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,
                        },
                    })
                    } 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
                    }
                    if (!res) {
                        return
                    }
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    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
                    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
                        })
                    }
                        this.enableEdit = 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
                    this.hform.HInterID = 0
                    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
                }
                } 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
                    this.hform.HInterID = 0
                    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
                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;
                    let res = await CommonUtils.doRequest2Sync({
                        url: "/Sb_PDA_EqpRepairWorkBill/SaveGetEqpRepairWorkBillList",
                        data: {
                            "msg": sMainSub
                        },
                        method: "POST"
                    })
                    let sSubStr = JSON.stringify(this.HDetailList);
                    let sMainSub = oMain + ';' + sSubStr;
                    let res = await CommonUtils.doRequest2Sync({
                        url: "/Sb_PDA_EqpRepairWorkBill/SaveGetEqpRepairWorkBillList",
                        data: {
                            "msg": sMainSub
                        },
                        method: "POST"
                    })
                    if (!res) {
                        return
                    }
                    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_EqpMaintenanceBill?operationType=1'
                                    })
                                } else if (res.cancel) {
                                    console.log('用户点击取消');
                                    setTimeout(() => {
                                        uni.navigateBack();
                                    }, 50)
                                }
                            }
                        });
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: "提交单据失败: " + Message
                        })
                    }
                    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_EqpMaintenanceBill?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,
                        },
                    })
                } 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
                    }
                    if (!res) {
                        return
                    }
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    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
                    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
                        })
                    }
                        this.enableEdit = false
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: err
                    })
                }
            },
            async getSendWorkBill(HSendWorkID) {
                try{
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Sb_EquipRepairSendWorkBill/GetEquipRepairSendWorkBillList",
                        data: {
                            sWhere: ` and hmainid ='${HSendWorkID}' `,
                            user: getUserInfo()["Czymc"]
                        }
                    })
                    let {data, count, Message} = res.data
                    if(count == 1) {
                        console.log('data: ',data);
                        this.hform.HRepairID = this.HRepairList.find(item => data[0]["表体维修项目"] == item["维修项目"])?.hitemid
                    }else {
                       CommonUtils.showTips({
                           title: "温馨提示",
                           message: `获取派工单失败: ${Message}`
                       })
                    }
                }catch(err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `获取派工单失败: ${err}`
                    })
                }
            },
            async getSourceBillInfo(HSourceBillType, HInterID, HBillNo, HSendWorkID) {
                // 下推单据类型为设备故障登记单
                if (HSourceBillType == 3907) {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Sb_EqpRepairWorkBill/Sb_EqpConkBookBillListCheckDetai",
                        data: {
                            HID: HInterID
                        }
                    })
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: err
                    })
                }
            },
            async getSendWorkBill(HSendWorkID) {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Sb_EquipRepairSendWorkBill/GetEquipRepairSendWorkBillList",
                        data: {
                            sWhere: ` and hmainid ='${HSendWorkID}' `,
                            user: getUserInfo()["Czymc"]
                        }
                    })
                    let {
                        data,
                        code,
                        count,
                        Message
                    } = res.data
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        console.log('data: ', data);
                        this.hform.HRepairID = this.HRepairList.find(item => data[0]["表体维修项目"] == item["维修项目"])
                            ?.hitemid
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `获取派工单失败: ${Message}`
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `获取派工单失败: ${err}`
                    })
                }
            },
            async getSourceBillInfo(HSourceBillType, HInterID, HBillNo, HSendWorkID) {
                // 下推单据类型为设备维修登记单
                if (HSourceBillType == 3907) {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Sb_EqpRepairWorkBill/Sb_EqpConkBookBillListCheckDetai",
                        data: {
                            HID: HInterID
                        }
                    })
                    if (code == 1) {
                        console.log('data: ', data.h_v_Sb_EquipConkBookBillList_Edit);
                        let data1 = data.h_v_Sb_EquipConkBookBillList_Edit[0]
                        this.hform.HMainSourceBillType = HSourceBillType
                        this.HMainSourceBillType = '设备故障登记单'
                        this.hform.HMainSourceBillNo = data1.单据号
                        this.hform.HMainSourceInterID = data1.hmainid
                        this.hform.HMainSourceEntryID = data1.hsubid
                        this.hform.HEquipID = data1.HEquipID
                        this.hform.HManagerName = data1.负责人
                        this.hform.HManagerID = data1.HManagerID
                        this.hform.HEmpID = data1["HEmpID"] || getUserInfo()["HEmpID"]
                        this.hform.HBarName = data1.设备名称
                        this.hform.HBarModel = data1.设备型号
                        this.hform.HBarSpec = data1.设备规格
                        this.hform.HExplanation = data1.故障原因描述
                        // this.hform.HRepairContent = data1.故障原因描述
                        this.getSendWorkBill(HSendWorkID)
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: `获取源单失败: ${Message}`
                        })
                    }
                }
            }
        },
        onLoad(e) {
            console.log('e: ', e);
            if (!e.operationType) {
                this.operationType = 1
            } else {
                this.operationType = e.operationType
            }
                    let {
                        data,
                        code,
                        count,
                        Message
                    } = res.data
            if (this.operationType == 1) {
                // 新增
                this.getMaxNum()
            } else if (this.operationType == 2) {
                // 复制
            } else if (this.operationType == 3) {
                // 编辑
                    if (code == 1) {
                        console.log('data: ', data.h_v_Sb_EquipConkBookBillList_Edit);
                        let data1 = data.h_v_Sb_EquipConkBookBillList_Edit[0]
                        this.hform.HMainSourceBillType = HSourceBillType
                        this.HMainSourceBillType = '设备维修登记单'
                        this.hform.HMainSourceBillNo = data1.单据号
                        this.hform.HMainSourceInterID = data1.hmainid
                        this.hform.HMainSourceEntryID = data1.hsubid
                        this.hform.HEquipID = data1.HEquipID
                        this.hform.HManagerName = data1.负责人
                        this.hform.HManagerID = data1.HManagerID
                        this.hform.HEmpID = data1["HEmpID"] || getUserInfo()["HEmpID"]
                        this.hform.HBarName = data1.设备名称
                        this.hform.HBarModel = data1.设备型号
                        this.hform.HBarSpec = data1.设备规格
                        this.hform.HExplanation = data1.故障原因描述
                        // this.hform.HRepairContent = data1.故障原因描述
            } else if (this.operationType == 4) {
                // 由报工平台打开
                let HEquipID = e.HEquipID
                this.getMaxNum()
                this.getEquipFileMain(HEquipID)
            } else if (this.operationType == 5) {
                let {
                    HSourceBillType,
                    HInterID,
                    HBillNo,
                    HSendWorkID
                } = e
                // 下推
                this.getMaxNum()
                this.getSourceBillInfo(HSourceBillType, HInterID, HBillNo,HSendWorkID)
            }
                        this.getSendWorkBill(HSendWorkID)
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: `获取源单失败: ${Message}`
                        })
                    }
                }
            }
        },
        onLoad(e) {
            console.log('e: ', e);
            if (!e.operationType) {
                this.operationType = 1
            } else {
                this.operationType = e.operationType
            }
            this.getHDeptList()
            this.getEmpList()
            this.getRepairList()
            this.loadCache()
            if (this.operationType == 1) {
                // 新增
                this.getMaxNum()
            } else if (this.operationType == 2) {
                // 复制
            } else if (this.operationType == 3) {
                // 编辑
            // 监听单据选择完成事件
            uni.$on('BillSelectComplete', (e) => {
                console.log("接收到的消息: ", e)
                this.hform.HMainSourceInterID = e.HInterID
                this.hform.HMainSourceBillNo = e.HBillNo
                this.hform.HMainSourceEntryID = e.HEntryID
                this.hform.HEquipID = e.HEquipID
                this.hform.HBarName = e.HEquipName
                this.hform.HBarSpec = e.HEquipSpec
                this.hform.HBarModel = e.HEquipModel
                this.$refs.billList.exit()
            })
        },
        onUnload() {
            uni.$off('BillSelectComplete')
        },
        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)
                })
        }
    }
            } else if (this.operationType == 4) {
                // 由报工平台打开
                let HEquipID = e.HEquipID
                this.getMaxNum()
                this.getEquipFileMain(HEquipID)
            } else if (this.operationType == 5) {
                let {
                    HSourceBillType,
                    HInterID,
                    HBillNo,
                    HSendWorkID
                } = e
                // 下推
                this.getMaxNum()
                this.getSourceBillInfo(HSourceBillType, HInterID, HBillNo, HSendWorkID)
            }
            this.getHDeptList()
            this.getEmpList()
            this.getRepairList()
            this.loadCache()
            this.updateEnableSourceBillEdit();
            // 监听单据选择完成事件
            uni.$on('BillSelectComplete', (e) => {
                console.log("接收到的消息: ", e)
                this.hform.HMainSourceInterID = e.HInterID
                this.hform.HMainSourceBillNo = e.HBillNo
                this.hform.HMainSourceEntryID = e.HEntryID
                this.hform.HEquipID = e.HEquipID
                this.hform.HBarName = e.HEquipName
                this.hform.HBarSpec = e.HEquipSpec
                this.hform.HBarModel = e.HEquipModel
                this.$refs.billList.exit()
            })
        },
        onUnload() {
            uni.$off('BillSelectComplete')
        },
        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";
    @import "@/pages/MJGL/style/MJBillStyle.scss";
    .picker-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1;
    }
    .picker-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1;
    }
</style>
pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBill.vue
@@ -236,7 +236,7 @@
                    "HConkReasonCode": "",
                    "HConkReasonName": "",
                    "HConkExplanation": "",
                    "HManagerID": "",
                    "HManagerID": "0",
                    "HManagerCode": "",
                    "HManagerName": "",
                    "HRemark": "  "
@@ -319,37 +319,37 @@
            },
            // 提交数据有效性校验
            ValidCheck() {
                if (this.hform.HEquipID == 0) {
                if (this.hform.HEquipID == 0 || this.hform.HEquipID === undefined) {
                    return {
                        Message: this.$t('Sb_EquipConkBookBill.noEquipInfo') == 'Sb_EquipConkBookBill.noEquipInfo' ? '未录入设备信息,请先录入设备信息!' : this.$t('Sb_EquipConkBookBill.noEquipInfo'),
                        state: false
                    }
                }
                if (this.hform.HDeptID == 0) {
                if (this.hform.HDeptID == 0 || this.hform.HDeptID === undefined) {
                    return {
                        Message: this.$t('Sb_EquipConkBookBill.deptRequired') == 'Sb_EquipConkBookBill.deptRequired' ? '部门不得为空!' : this.$t('Sb_EquipConkBookBill.deptRequired'),
                        state: false
                    }
                }
                if (this.hform.HEmpID == 0) {
                if (this.hform.HEmpID == 0 || this.hform.HEmpID === undefined) {
                    return {
                        Message: this.$t('Sb_EquipConkBookBill.discovererRequired') == 'Sb_EquipConkBookBill.discovererRequired' ? '发现人不得为空!' : this.$t('Sb_EquipConkBookBill.discovererRequired'),
                        state: false
                    }
                }
                if (this.hform.HManagerID == 0) {
                if (this.hform.HManagerID === 0 || this.hform.HManagerID === undefined) {
                    return {
                        Message: this.$t('Sb_EquipConkBookBill.checkerRequired') == 'Sb_EquipConkBookBill.checkerRequired' ? '验收人不得为空!' : this.$t('Sb_EquipConkBookBill.checkerRequired'),
                        state: false
                    }
                }
                if (this.hform.HConkReasonID == 0) {
                if (this.hform.HConkReasonID == 0 || this.hform.HConkReasonID === undefined) {
                    return {
                        Message: this.$t('Sb_EquipConkBookBill.reasonRequired') == 'Sb_EquipConkBookBill.reasonRequired' ? '故障原因不得为空!' : this.$t('Sb_EquipConkBookBill.reasonRequired'),
                        state: false
                    }
                }
                if (this.hform.HConkTypeID == 0) {
                if (this.hform.HConkTypeID == 0 || this.hform.HConkTypeID === undefined) {
                    return {
                        Message: this.$t('Sb_EquipConkBookBill.typeRequired') == 'Sb_EquipConkBookBill.typeRequired' ? '故障类别不得为空!' : this.$t('Sb_EquipConkBookBill.typeRequired'),
                        state: false
pages/MJGL/Sb_EquipRepairCheckBill/Sb_EquipRepairCheckBill.vue
@@ -41,12 +41,7 @@
                        </radio-group>
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">验收内容:</view>
                    <view class="right">
                        <textarea v-model="HDetailList[0].HRepairCheckContent" placeholder="请输入验收内容" />
                    </view>
                </view>
                <!-- 维修记录(源单) -->
                <view class="form-item">
                    <view class="title required">维修记录:</view>
@@ -89,17 +84,23 @@
                    </zxz-uni-data-select>
                </view>
                <view class="form-item">
                    <view class="title">验收项目:</view>
                    <zxz-uni-data-select required class="right" :localdata="HRepairCheckList" dataKey="维修验收项目"
                        dataValue="hitemid" v-model="hform.HRepairCheckID">
                    </zxz-uni-data-select>
                </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>
                </view>
                <view class="form-item">
                    <view class="title required">验收项目:</view>
                    <zxz-uni-data-select required class="right" :localdata="HRepairCheckList" dataKey="维修验收项目"
                        dataValue="hitemid" v-model="hform.HRepairCheckID">
                    </zxz-uni-data-select>
                </view>
                <view class="form-item">
                    <view class="title">验收内容:</view>
                    <view class="right">
                        <textarea v-model="HDetailList[0].HRepairCheckContent" placeholder="请输入验收内容" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">设备名称:</view>
                    <view class="righton">
@@ -118,6 +119,12 @@
                        <input v-model="hform.HBarModel" disabled />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">备注:</view>
                    <view class="right">
                        <textarea v-model="hform.HRemark" placeholder="请输入备注" />
                    </view>
                </view>
            </view>
        </template>
        <!-- 其他信息 -->
@@ -187,7 +194,7 @@
        <xe-upload ref="XeUpload" :options="uploadOptions" @callback="handleUploadCallback"></xe-upload>
        <!-- 源单单据列表弹窗 -->
        <BillListPopupEquipConkBookBillVue ref="billList" :HBillType="hform.HBillType" :HSourceBillType="'设备维修记录单'"
        <BillListPopupEquipConkBookBillVue ref="billList" :HEquipID="hform.HEquipID" :HBillType="hform.HBillType" :HSourceBillType="'设备维修记录单'"
            :HStockOrgID="hform.HStockOrgID">
        </BillListPopupEquipConkBookBillVue>
    </view>
@@ -249,6 +256,7 @@
                    "HEquipID": 0,
                    "HBarSpec": "",
                    "HBarModel": "",
                    "HRemark": "",
                    "HMaker": getUserInfo()["Czymc"],
                    "HMakeDate": dayjs(new Date()).format("YYYY-MM-DD"),
                    "HUpDater": "",
@@ -390,36 +398,37 @@
            // 提交数据有效性校验
            ValidCheck() {
                if (this.hform.HEquipID == 0) {
                if (this.hform.HEquipID == 0 || this.hform.HEquipID === undefined) {
                    return {
                        Message: "未录入设备信息,请先录入设备信息!",
                        state: false
                    }
                }
                if (this.hform.HDeptID == 0) {
                if (this.hform.HDeptID == 0 || this.hform.HDeptID === undefined) {
                    return {
                        Message: "部门不得为空!",
                        state: false
                    }
                }
                if (this.hform.HEmpID == 0) {
                if (this.hform.HEmpID == 0 || this.hform.HEmpID === undefined) {
                    return {
                        Message: "验收人不得为空!",
                        state: false
                    }
                }
                if (this.hform.HRepairCheckID == 0) {
                if (this.hform.HManagerID == 0 || this.hform.HManagerID === undefined) {
                    return {
                        Message: "负责人不得为空!",
                        state: false
                    }
                }
                if (this.hform.HRepairCheckID == 0 || this.hform.HRepairCheckID === undefined) {
                    return {
                        Message: "验证项目不得为空!",
                        Message: "验收项目不得为空!",
                        state: false
                    }
                }
                if (this.hform.HManagerID == 0) {
                    return {
                        Message: "负责人不得为空!",
                        state: false
                    }
                }
                // 新增:维修记录校验
                if (!this.hform.HMainSourceBillNo || this.hform.HMainSourceBillNo.trim() === '') {
                    return {
@@ -723,11 +732,6 @@
                    if(count == 1) {
                        this.hform.HRepairCheckID = this.HRepairCheckList.find(item => data[0]["表体维修项目"] == item["维修验收项目"])?.hitemid
                        this.HDetailList[0].HRepairCheckContent = data[0].维修内容
                    }else {
                       CommonUtils.showTips({
                           title: "温馨提示",
                           message: `获取派工单失败: ${Message}`
                       })
                    }
                }catch(err) {
                    CommonUtils.showTips({
pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBill.vue
@@ -32,13 +32,7 @@
                            <input :value="hform.HRepairPlanEndDate" />
                        </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>
                <!-- 源单类型 -->
                <view class="form-item">
                    <view class="title">源单类型:</view>
@@ -113,17 +107,29 @@
                    </zxz-uni-data-select>
                </view>
                <view class="form-item">
                    <view class="title">维修项目:</view>
                    <zxz-uni-data-select class="right" :localdata="HRepairList" dataKey="维修项目"
                        dataValue="hitemid" v-model="hform.HRepairID">
                    </zxz-uni-data-select>
                </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>
                </view>
                <view class="form-item">
                    <view class="title required">维修项目:</view>
                    <zxz-uni-data-select class="right" :localdata="HRepairList" dataKey="维修项目"
                        dataValue="hitemid" v-model="hform.HRepairID">
                    </zxz-uni-data-select>
                </view>
                <view class="form-item">
                    <view class="title">维修要求:</view>
                    <view class="right">
                        <textarea v-model="HDetailList[0].HRepairExplanation" placeholder="请输入维修要求" />
                    </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">
@@ -142,18 +148,12 @@
                        <input v-model="hform.HBarModel" disabled />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">备注:</view>
                    <view class="right">
                        <textarea v-model="hform.HRemark" placeholder="请输入备注" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">维修要求:</view>
                    <view class="right">
                        <textarea v-model="HDetailList[0].HRepairExplanation" placeholder="请输入维修要求" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">备注:</view>
                    <view class="right">
                        <textarea v-model="hform.HRemark" placeholder="请输入备注" />
                    </view>
                </view>
            </view>
        </template>
@@ -223,7 +223,7 @@
        </view>
        <!-- <xe-upload ref="XeUpload" :options="uploadOptions" @callback="handleUploadCallback"></xe-upload> -->
        <!-- 源单单据列表弹窗 -->
        <BillListPopupEquipConkBookBillVue ref="billList" :HBillType="HBillType"
        <BillListPopupEquipConkBookBillVue ref="billList" :HBillType="HBillType" :HEquipID="hform.HEquipID"
            :HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID">
        </BillListPopupEquipConkBookBillVue>
    </view>
@@ -527,30 +527,36 @@
            },
            // 提交数据有效性校验
            ValidCheck() {
                if (this.hform.HEquipID == 0) {
                if (this.hform.HEquipID == 0 || this.hform.HEquipID === undefined) {
                    return {
                        Message: "未录入设备信息,请先录入设备信息!",
                        state: false
                    }
                }
                if (this.hform.HDeptID == 0) {
                if (this.hform.HDeptID == 0 || this.hform.HDeptID === undefined) {
                    return {
                        Message: "部门不得为空!",
                        state: false
                    }
                }
                if (this.hform.HEmpID == 0) {
                if (this.hform.HEmpID == 0 || this.hform.HEmpID === undefined) {
                    return {
                        Message: "维修人不得为空!",
                        state: false
                    }
                }
                if (this.hform.HManagerID == 0) {
                if (this.hform.HManagerID == 0 || this.hform.HManagerID === undefined) {
                    return {
                        Message: "负责人不得为空!",
                        state: false
                    }
                }
                if (this.hform.HRepairID == 0 || this.hform.HRepairID === undefined) {
                    return {
                        Message: "维修项目不得为空!",
                        state: false
                    }
                }
                // 添加源单校验(如果不是手工录入,则必须选择源单)
                if (this.hform.HMainSourceBillType !== '手工录入') {
                    if (!this.hform.HMainSourceBillNo || this.hform.HMainSourceBillNo.trim() === '') {
@@ -764,7 +770,7 @@
            },
            toScanCode() {
                MpaasScan.scanCode(cb => {
                    this.hform.HBarCode = cb; // 修复:原来是 hfrom 应该是 hform
                    this.hform.HBarCode = cb;
                    this.GetMessageByBarCode(cb)
                })
            },