zrg
2026-01-21 e8d4cc42b3ce74a818705aab13c2131d81a5ed6b
模具出入库和维修验收优化
1个文件已添加
8个文件已修改
1843 ■■■■■ 已修改文件
components/BillListPopup/BillListPopuMouldRepairRecordPopup.vue 385 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/SC_MouldRepairCheck/Sc_MouldRepairCheckBill.vue 1275 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/Sc_MouldRepairWorkBill/Sc_MouldRepairWorkBill.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/mujulingliaochukudan/MouldProdOutBill.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/mujulingliaotuikudan/Sc_MouldProdBackBill.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/ZLGL/QuYangHuangYang/QC_TakeSampleCheckBill/QC_TakeSampleCheckBill.vue 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/tab2.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/tab3.vue 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/BillListPopup/BillListPopuMouldRepairRecordPopup.vue
New file
@@ -0,0 +1,385 @@
<template>
    <view>
        <uni-popup ref="popup" type="bottom" @change="popupChangeHandler">
            <view class="content">
                <view class="search-condition">
                    <view class="title"><text>日期: </text></view>
                    <view class="daterange" style="flex: 1;">
                        <view class="right general">
                            <uni-datetime-picker type="date" :clear-icon="false" v-model="HBeginDate">
                                <view>{{HBeginDate}}</view>
                            </uni-datetime-picker>
                        </view>
                        <view>—</view>
                        <view class="right general">
                            <uni-datetime-picker type="date" :clear-icon="false" v-model="HEndDate">
                                <view>{{HEndDate}}</view>
                            </uni-datetime-picker>
                        </view>
                    </view>
                </view>
                <!-- 保持与故障登记单相同的搜索条件 -->
                <view class="search-condition">
                    <view class="title"><text>模具编码: </text></view>
                    <view class="right"><input type="text" :focus="enablefocus" v-model="HNumber"
                            @confirm="getRepairRecordList" /></view>
                </view>
                <view class="search-condition">
                    <view class="title"><text>模具名称: </text></view>
                    <view class="right"><input type="text" v-model="HName" @confirm="getRepairRecordList" /></view>
                </view>
                <view class="search-condition">
                    <view class="title"><text>单据号: </text></view>
                    <view class="right"><input type="text" v-model="HBillNo" @confirm="getRepairRecordList" /></view>
                </view>
                <view class="buttons">
                    <view style="flex: 1;"></view>
                    <button size="mini" type="primary" @click="search">搜索</button>
                    <button size="mini" type="primary" @click="exit">退出</button>
                </view>
                <scroll-view id="#BillListPanel" scroll-y="true" style="height: 50vh;">
                    <view class="options-wrapper" v-show="HRepairRecordList.length != 0">
                        <uni-card :is-active="record.isActive" :class="record.isActive?'uni-card--is-active':''"
                            v-for="(record, index) in HRepairRecordList[curPage-1]" :key="index"
                            :title="record['单据号'] || record['HBillNo'] || record['维修单号']"
                            @tap="clickCard(record, index)">
                            <view class="item">
                                <view class="left">日期: </view>
                                <view class="right">{{dayjs(record['日期'] || record['维修日期'] || record['HDate']).format('YYYY-MM-DD')}}</view>
                            </view>
                            <view class="item" v-if="record['模具编码'] || record['HMouldCode']">
                                <view class="left">模具编码: </view>
                                <view class="right">{{record['产品模具代码'] || record['HMouldCode']}}</view>
                            </view>
                            <view class="item" v-if="record['模具名称'] || record['HMouldName']">
                                <view class="left">模具名称: </view>
                                <view class="right">{{record['产品模具'] || record['HMouldName']}}</view>
                            </view>
                            <view class="item" v-if="record['模具规格'] || record['HMouldSpec']">
                                <view class="left">模具规格: </view>
                                <view class="right">{{record['模具规格'] || record['HMouldSpec']}}</view>
                            </view>
                            <view class="item" v-if="record['模具型号'] || record['HMouldModel']">
                                <view class="left">模具型号: </view>
                                <view class="right">{{record['模具型号'] || record['HMouldModel']}}</view>
                            </view>
                            <view class="item" v-if="record['维修单号'] || record['HRepairNo']">
                                <view class="left">维修单号: </view>
                                <view class="right">{{record['维修单号'] || record['HRepairNo']}}</view>
                            </view>
                            <view class="item" v-if="record['维修内容'] || record['HRepairContent']">
                                <view class="left">维修内容: </view>
                                <view class="right">{{record['维修内容'] || record['HRepairContent']}}</view>
                            </view>
                            <view class="item" v-if="record['维修人'] || record['HEmpName']">
                                <view class="left">维修人: </view>
                                <view class="right">{{record['维修人'] || record['HEmpName']}}</view>
                            </view>
                            <view class="item" v-if="record['维修人'] || record['HStatus']">
                                <view class="left">维修人: </view>
                                <view class="right">{{record['维修人'] || record['HStatus']}}</view>
                            </view>
                        </uni-card>
                    </view>
                    <view class="over" v-show="HRepairRecordList.length == 0">暂无数据</view>
                </scroll-view>
                <uni-pagination id="#pagination" title="标题文字" v-model="curPage" :pageSize="size"
                    :total="length"></uni-pagination>
            </view>
        </uni-popup>
    </view>
</template>
<script>
    import dayjs from 'dayjs';
    import {
        CommonUtils
    } from '../../utils/common';
    import {
        getUserInfo
    } from '../../utils/auth';
    export default {
        name: "RepairRecordPopup",
        data() {
            return {
                dayjs: dayjs,
                enablefocus: false,
                size: 20,
                curPage: 1,
                length: 0,
                page: 0,
                HMouldID: 0, // 当前选择的模具ID
                HRepairRecordList: [],
                // 搜索条件 - 与故障登记单保持一致
                HBeginDate: dayjs(new Date()).subtract(30, 'd').format("YYYY-MM-DD"),
                HEndDate: dayjs(new Date()).format("YYYY-MM-DD"),
                HNumber: '',
                HName: '',
                HBillNo: '',
            };
        },
        props: {
            HBillType: {
                type: [String, Number],
                required: true
            },
            HStockOrgID: {
                type: [String, Number],
                required: true
            },
            // 新增一个是否显示模具信息的参数
            showMouldInfo: {
                type: Boolean,
                default: true
            }
        },
        methods: {
            popupChangeHandler(e) {
                if (e.show === true) {
                    this.getRepairRecordList()
                }
            },
            async exit() {
                this.resetSearchConditions();
                await this.$nextTick();
                this.$refs.popup.close();
            },
            resetSearchConditions() {
                this.size = 20;
                this.curPage = 1;
                this.length = 0;
                this.page = 0;
                this.HRepairRecordList = [];
                this.enablefocus = false;
                // 重置搜索条件
                this.HBeginDate = dayjs(new Date()).subtract(30, 'd').format("YYYY-MM-DD");
                this.HEndDate = dayjs(new Date()).format("YYYY-MM-DD");
                this.HNumber = '';
                this.HName = '';
                this.HBillNo = '';
                this.HRepairNo = '';
                this.HRepairContent = '';
                this.HRepairStatus = '';
            },
            showPopup(HMouldID) {
                this.HMouldID = HMouldID || 0;
                this.resetSearchConditions();
                this.$refs.popup.open();
            },
            search() {
                this.getRepairRecordList();
            },
            repairStatusChange(e) {
                const index = e.detail.value;
                if (index == 0) {
                    this.HRepairStatus = ''; // 全部
                } else {
                    this.HRepairStatus = this.repairStatusOptions[index];
                }
            },
            clickCard(record, index) {
                // 发送选择完成事件
                uni.$emit('RepairRecordSelectComplete', {
                    HInterID: record["hmainid"],
                    HEntryID: record["hsubid"] || record["HEntryID"] || 0,
                    HBillNo: record["单据号"] || record["HBillNo"] || "",
                    HMouldID: record['HMouldID'] || this.HMouldID || 0,
                    HMouldName: record['产品模具'],
                    HMouldCode: record['产品模具代码'],
                    HMouldSpec: record['模具规格'],
                    HMouldModel: record['模具型号']
                });
            },
            getsWhere() {
                let sWhere = '';
                // 日期范围条件 - 与故障登记单保持一致
                if (this.HBeginDate && this.HEndDate) {
                    sWhere += ` and (CONVERT(varchar(100),日期, 23) between '${this.HBeginDate}' and '${this.HEndDate}') `;
                }
                // 模具ID条件 - 如果传入了模具ID
                if (this.HMouldID) {
                    sWhere += ` and HMouldID = ${this.HMouldID} `;
                }
                // 模具编码条件
                if (this.HNumber) {
                    sWhere += ` and (产品模具代码 like '%${this.HNumber}%'  `;
                }
                // 模具名称条件
                if (this.HName) {
                    sWhere += ` and (产品模具 like '%${this.HName}%' `;
                }
                // 单据号条件
                if (this.HBillNo) {
                    sWhere += ` and (单据号 like '%${this.HBillNo}%'  `;
                }
                return sWhere;
            },
            getRepairRecordList() {
                this.HRepairRecordList = [];
                this.length = 0;
                this.page = 0;
                this.curPage = 1;
                // 调用维修记录列表接口
                CommonUtils.doRequest(
                    "/Sb_MouldRepairWorkBill/GetMouldRepairWorkBill_PDA", {  // 请根据实际情况调整接口路径
                        sWhere: this.getsWhere(),
                        user: getUserInfo()["Czymc"]
                    },
                    (res) => {
                        let {
                            data,
                            count,
                            Message
                        } = res.data;
                        if (count == 1) {
                            this.length = Array.from(data).length;
                            const result = [];
                            for (let i = 0; i < data.length; i += this.size) {
                                result.push(data.slice(i, i + this.size));
                            }
                            this.HRepairRecordList = result;
                            this.page = result.length;
                            setTimeout(() => {
                                this.enablefocus = true;
                            }, 500);
                        } else {
                            setTimeout(() => {
                                this.enablefocus = true;
                            }, 500);
                            uni.showToast({
                                icon: 'none',
                                title: Message || '暂无维修记录数据'
                            });
                        }
                    },
                    (err) => {
                        setTimeout(() => {
                            this.enablefocus = true;
                        }, 500);
                        uni.showToast({
                            icon: 'none',
                            title: '加载失败: ' + (err.message || '未知错误')
                        });
                    }
                );
            }
        }
    }
</script>
<style lang="scss">
    .content {
        box-sizing: border-box;
        border-radius: 15rpx 15rpx 0 0;
        padding: 20rpx 20rpx 40rpx 20rpx;
        background-color: #fff;
        display: flex;
        flex-direction: column;
        gap: 10rpx;
        .search-condition {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 20rpx;
            font-size: 30rpx;
            .title {
                width: 5rem;
                text-align: right;
            }
            .right {
                flex: 1;
                border-radius: 22rpx;
                border: 1px solid #acacac;
                height: auto;
                padding: 8rpx 16rpx;
                input {
                    width: 100%;
                    font-size: 30rpx;
                }
                picker {
                    width: 100%;
                    font-size: 30rpx;
                    line-height: 1.5;
                }
            }
        }
        .buttons {
            display: flex;
            flex-direction: row;
            gap: 20rpx;
            justify-content: flex-end;
            >button {
                display: inline-flex;
                width: 4rem;
            }
        }
        .options-wrapper {
            padding: 20rpx;
            display: grid;
            grid-template-columns: repeat(1, 1fr);
            gap: 20rpx;
            >view {
                margin: 0 !important;
                box-sizing: border-box;
            }
            .item {
                .left {
                    display: inline-block;
                    width: 6rem;
                    font-size: 26rpx;
                    color: #666;
                }
                .right {
                    display: inline-block;
                    font-size: 28rpx;
                    color: #333;
                    word-break: break-all;
                }
            }
        }
        .uni-card--is-active {
            background-color: rgba(0, 122, 255, 0.2);
        }
        .daterange {
            display: flex;
            flex-direction: row;
            gap: 10rpx;
            justify-content: center;
            align-items: center;
        }
        .over {
            text-align: center;
            padding: 100rpx 0;
            color: #999;
            font-size: 28rpx;
        }
    }
</style>
pages.json
@@ -449,14 +449,14 @@
        {
            "path": "pages/mujvzhuangtai/mujvzhuangtai",
            "style": {
                "navigationBarTitleText": "模具状态分布",
                "navigationBarTitleText": "器具状态分布",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/mujvzhuangtai/detail",
            "style": {
                "navigationBarTitleText": "模具状态详情"
                "navigationBarTitleText": "器具状态详情"
            }
        },
        {
@@ -608,39 +608,51 @@
        {
            "path": "pages/MJGL/mujudianjianjiludan/Sc_MouldDotCheckBillList",
            "style": {
                "navigationBarTitleText": "模具点检记录单列表",
                "navigationBarTitleText": "器具点检记录单列表",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/MJGL/mujudianjianjiludan/Sc_MouldDotCheckBill",
            "style": {
                "navigationBarTitleText": "模具点检记录单"
                "navigationBarTitleText": "器具点检记录单"
            }
        },
        {
            "path": "pages/MJGL/mujudianjianjiludan/Sc_MouldDotCheckRuleBillList",
            "style": {
                "navigationBarTitleText": "模具点检规程"
                "navigationBarTitleText": "器具点检规程"
            }
        },
        {
            "path": "pages/MJGL/mujubaoyangjiludan/Sc_MouldMaintainBillList",
            "style": {
                "navigationBarTitleText": "模具保养记录单列表",
                "navigationBarTitleText": "器具保养记录单列表",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/MJGL/mujubaoyangjiludan/Sc_MouldMaintainBill",
            "style": {
                "navigationBarTitleText": "模具保养记录单"
                "navigationBarTitleText": "器具保养记录单"
            }
        },
        {
            "path": "pages/MJGL/SBMJReport/Sc_MouldMaintainTaskReport",
            "style": {
                "navigationBarTitleText": "器具保养任务"
            }
        },
        {
            "path": "pages/MJGL/SBMJReport/Sb_EquipMaintainTaskReport",
            "style": {
                "navigationBarTitleText": "设备保养任务"
            }
        },
        {
            "path": "pages/MJGL/mujubaoyangjiludan/Sc_MouldMaintainRuleBillList",
            "style": {
                "navigationBarTitleText": "模具保养规程"
                "navigationBarTitleText": "器具保养规程"
            }
        },
        {
@@ -1107,21 +1119,21 @@
        {
            "path": "pages/MJGL/mujulingliaochukudan/MouldProdOutBill",
            "style": {
                "navigationBarTitleText": "模具领料出库单",
                "navigationBarTitleText": "器具领用出库单",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/MJGL/mujulingliaochukudan/MouldProdOutBillList",
            "style": {
                "navigationBarTitleText": "模具领料出库单",
                "navigationBarTitleText": "器具领用出库单列表",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/MJGL/mujulingliaotuikudan/Sc_MouldProdBackBillList",
            "style": {
                "navigationBarTitleText": "模具领料退库单",
                "navigationBarTitleText": "器具领用退库单",
                "enablePullDownRefresh": true
            }
        },
@@ -1175,54 +1187,54 @@
        {
            "path": "pages/shoujishouming/table",
            "style": {
                "navigationBarTitleText": "模具寿命调整单",
                "navigationBarTitleText": "器具寿命调整单",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/shoujishouming/form",
            "style": {
                "navigationBarTitleText": "模具寿命调整单",
                "navigationBarTitleText": "器具寿命调整单",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/MJGL/mujulingliaochukudan/MouldProdOutBill",
            "style": {
                "navigationBarTitleText": "模具领料出库单"
                "navigationBarTitleText": "器具领用出库单"
            }
        },
        {
            "path": "pages/MJGL/mujulingliaochukudan/MouldProdOutBillList",
            "style": {
                "navigationBarTitleText": "模具领料出库单",
                "navigationBarTitleText": "器具领用出库单列表",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/MJGL/mujulingliaotuikudan/Sc_MouldProdBackBillList",
            "style": {
                "navigationBarTitleText": "模具领料退库单",
                "navigationBarTitleText": "器具领用退库单列表",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/MJGL/mujulingliaotuikudan/Sc_MouldProdBackBill",
            "style": {
                "navigationBarTitleText": "模具领料退库单"
                "navigationBarTitleText": "器具领用退库单"
            }
        },
        {
            "path": "pages/MJGL/qijudiaobodan/Sc_MouldMoveStockBillList",
            "style": {
                "navigationBarTitleText": "模具调拨单",
                "navigationBarTitleText": "器具调拨单",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/MJGL/qijudiaobodan/Sc_MouldMoveStockBill",
            "style": {
                "navigationBarTitleText": "模具调拨单",
                "navigationBarTitleText": "器具调拨单",
                "enablePullDownRefresh": true
            }
        },
@@ -1250,27 +1262,27 @@
        {
            "path": "pages/MJGL/Sc_MouldRepairWorkBill/Sc_MouldRepairWorkBillList",
            "style": {
                "navigationBarTitleText": "模具维修记录单列表",
                "navigationBarTitleText": "器具维修记录单列表",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/MJGL/Sc_MouldRepairWorkBill/Sc_MouldRepairWorkBill",
            "style": {
                "navigationBarTitleText": "模具维修记录单"
                "navigationBarTitleText": "器具维修记录单"
            }
        },
        {
            "path": "pages/MJGL/Sc_MouldConkBookBill/Sc_MouldConkBookBill",
            "style": {
                "navigationBarTitleText": "模具故障登记单"
                "navigationBarTitleText": "器具故障登记单"
            }
        },
        {
            "path": "pages/MJGL/Sc_MouldConkBookBill/Sc_MouldConkBookBillList",
            "style": {
                "navigationBarTitleText": "模具故障登记单列表"
                "navigationBarTitleText": "器具故障登记单列表"
            }
        },
        {
@@ -1422,7 +1434,7 @@
        {
            "path": "pages/MJGL/Gy_MouldFile/Gy_MouldFileList",
            "style": {
                "navigationBarTitleText": "模具档案查询",
                "navigationBarTitleText": "器具档案查询",
                "enablePullDownRefresh": true
            }
        },
@@ -1442,13 +1454,13 @@
        {
            "path": "pages/MJGL/MouldScrapOutBill/MouldScrapOutBillList",
            "style": {
                "navigationBarTitleText": "模具报废出库单列表"
                "navigationBarTitleText": "器具报废出库单列表"
            }
        },
        {
            "path": "pages/MJGL/MouldScrapOutBill/MouldScrapOutBill",
            "style": {
                "navigationBarTitleText": "模具报废出库单",
                "navigationBarTitleText": "器具报废出库单",
                "enablePullDownRefresh": true
            }
        },
pages/MJGL/SC_MouldRepairCheck/Sc_MouldRepairCheckBill.vue
@@ -1,635 +1,718 @@
<template>
    <view>
        <view class="tabs" id="tabs">
            <view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">基本信息</view>
            <!-- <view :class="tabs == 1 ? 'on':''" @tap="tabs = 1">明细信息</view> -->
            <view :class="tabs == 2 ? 'on':''" @tap="tabs = 2">其他信息</view>
            <!-- <view :class="tabs == 3 ? 'on':''" @tap="tabs = 3">附件信息</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 none-border">
                        <radio-group @change="radioChange" class="radio_Container">
                            <label>
                                <view>
                                    <radio value="OK" :checked="hform.HCheckResult == 'OK'" />
                                    <text>OK</text>
                                </view>
                            </label>
                            </label>
                            <view>
                                <radio value="NG" :checked="hform.HCheckResult == 'NG'" />
                                <text>NG</text>
                            </view>
                            </label>
                        </radio-group>
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">验收内容:</view>
                    <view class="right">
                        <textarea v-model="hform.HRepairCheckMainContent" placeholder="请输入验收内容" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">源单类型:</view>
                    <zxz-uni-data-select class="right" :localdata="[
                        {key: '手工录入', value: '-1'},
                        {key: '模具故障登记单', value: '3815'}
                        ]" dataKey="key" dataValue="value" v-model="hform.HMainSourceBillType">
                <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 none-border">
                        <radio-group @change="radioChange" class="radio_Container">
                            <label>
                                <view>
                                    <radio value="OK" :checked="hform.HCheckResult == 'OK'" />
                                    <text>OK</text>
                                </view>
                            </label>
                            </label>
                            <view>
                                <radio value="NG" :checked="hform.HCheckResult == 'NG'" />
                                <text>NG</text>
                            </view>
                            </label>
                        </radio-group>
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">验收内容:</view>
                    <view class="right">
                        <textarea v-model="hform.HRepairCheckMainContent" placeholder="请输入验收内容" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">源单类型</view>
                    <view class="right" v-show="showHMainSourceBillType">
                        <picker :range="arrayHMainSourceBillType" @change="HMainSourceBillTypeChange">
                    </zxz-uni-data-select>
                    <!-- <input disabled v-model="hform.HDeptName" placeholder="请选择部门" /> -->
                </view>
                <view class="form-item">
                    <view class="title">源单号:</view>
                    <view class="right">
                        <input v-model="hform.HMainSourceBillNo" />
                    </view>
                    <view class="icon-wrapper">
                        <uni-icons type="search" size="20" @click="toCheckFile"></uni-icons>
                    </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 required">部门:</view>
                    <zxz-uni-data-select required class="right" :localdata="HDeptList" dataKey="部门名称"
                        dataValue="HItemID" v-model="hform.HDeptID">
                            <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 required">故障登记单</view>
                    <view class="right" v-show="hform.HMainSourceBillType != 1">
                        <input type="text" name="HBarCode" v-model="hform.HMainSourceBillNo" />
                    </view>
                    <view class="icon-wrapper" v-show="hform.HMainSourceBillType != 1"
                        :disabled="hform.HMainSourceBillType == -1">
                        <uni-icons type="search" size="20" @click="showBillList"></uni-icons>
                    </view>
                    <view class="righton" v-show="hform.HMainSourceBillType == 1">
                        <input type="text" disabled name="HBarCode" v-model="hform.HMainSourceBillNo" />
                    </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 required">部门:</view>
                    <zxz-uni-data-select required class="right" :localdata="HDeptList" dataKey="部门名称"
                        dataValue="HItemID" v-model="hform.HDeptID">
                    </zxz-uni-data-select>
                    <!-- <input disabled v-model="hform.HDeptName" placeholder="请选择部门" /> -->
                </view>
                <view class="form-item">
                    <view class="title required">验收人:</view>
                    <zxz-uni-data-select required class="right" :localdata="HEmpList" dataKey="HName"
                        dataValue="HItemID" v-model="hform.HEmpID">
                    </zxz-uni-data-select>
                    <!-- <input disabled v-model="hform.HDeptName" placeholder="请选择部门" /> -->
                </view>
                <view class="form-item">
                    <view class="title required">验收项目:</view>
                    <zxz-uni-data-select required class="right" :localdata="HRepairCheckList" dataKey="维修验收项目"
                        dataValue="hitemid" v-model="hform.HRepairCheckMainID">
                    </zxz-uni-data-select>
                    <!-- <input disabled v-model="hform.HDeptName" placeholder="请选择部门" /> -->
                </view>
                <view class="form-item">
                    <view class="title required">负责人:</view>
                    <zxz-uni-data-select required class="right" :localdata="HEmpList" dataKey="HName"
                        dataValue="HItemID" v-model="hform.HManagerID">
                    </zxz-uni-data-select>
                    <!-- <input disabled v-model="hform.HDeptName" placeholder="请选择部门" /> -->
                </view>
                <!-- 扫码带出维修记录 -->
                <view class="form-item">
                    <view class="title required">维修记录:</view>
                    <view class="right">
                        <input type="text" value="" />
                    </view>
                    <view class="icon-wrapper">
                        <uni-icons type="search" size="20" @click="toCheckFile"></uni-icons>
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">模具名称:</view>
                    <view class="righton">
                        <input v-model="hform.HMouldName" disabled />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">模具规格:</view>
                    <view class="righton">
                        <input v-model="hform.HMouldSpec" disabled />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">模具型号:</view>
                    <view class="righton">
                        <input v-model="hform.HMouldModel" disabled />
                    </view>
                </view>
            </view>
        </template>
        <!-- 其他信息 -->
        <template v-if="tabs == 2">
            <view class="form" :style="{
                    </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 required">验收项目:</view>
                    <zxz-uni-data-select required class="right" :localdata="HRepairCheckList" dataKey="维修验收项目"
                        dataValue="hitemid" v-model="hform.HRepairCheckMainID">
                    </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>
                    <view class="right" v-show="hform.HMainSourceBillType != 1">
                        <input type="text" v-model="hform.HMouldRepairWorkName"
                            :disabled="hform.HMainSourceBillType == -1" placeholder="请选择维修记录" />
                    </view>
                    <view class="icon-wrapper" v-show="hform.HMainSourceBillType != 1"
                        :disabled="hform.HMainSourceBillType == -1">
                        <uni-icons type="search" size="20" @click="showRepairRecordList"></uni-icons>
                    </view>
                    <view class="righton" v-show="hform.HMainSourceBillType == 1">
                        <input type="text" disabled v-model="hform.HMouldRepairWorkName" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">模具名称:</view>
                    <view class="righton">
                        <input v-model="hform.HMouldName" disabled />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">模具规格:</view>
                    <view class="righton">
                        <input v-model="hform.HMouldSpec" disabled />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">模具型号:</view>
                    <view class="righton">
                        <input v-model="hform.HMouldModel" disabled />
                    </view>
                </view>
            </view>
        </template>
        <!-- 其他信息 -->
        <template v-if="tabs == 2">
            <view class="form" :style="{
                height: containerHeight + 'px',
                overflow: 'auto'
            }">
                <view class="form-item">
                    <view class="title">创建人:</view>
                    <view class="righton">
                        <input v-model="hform.HMaker" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">创建日期:</view>
                    <view class="righton">
                        <input v-model="hform.HMakeDate" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">修改人:</view>
                    <view class="righton">
                        <input v-model="hform.HUpDater" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">修改日期:</view>
                    <view class="righton">
                        <input v-model="hform.HUpDateDate" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">审核人:</view>
                    <view class="righton">
                        <input v-model="hform.HChecker" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">审核时间:</view>
                    <view class="righton">
                        <input v-model="hform.HCheckDate" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">作废人:</view>
                    <view class="righton">
                        <input v-model="hform.HDeleteMan" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">作废日期:</view>
                    <view class="righton">
                        <input v-model="hform.HDeleteDate" />
                    </view>
                </view>
            </view>
                <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" size="mini" @tap="addNew">新增</button>
            <button class="btn-c" size="mini" @tap="goBack">退出</button>
        </view>
        <xe-upload ref="XeUpload" :options="uploadOptions" @callback="handleUploadCallback"></xe-upload>
    </view>
        </template>
        <!-- 操作按钮 -->
        <view class="buttons" id="buttons">
            <button class="btn-a" size="mini" @tap="submit">提交</button>
            <view style="flex: 1;"></view>
            <button class="btn-a" size="mini" @tap="addNew">新增</button>
            <button class="btn-c" size="mini" @tap="goBack">退出</button>
        </view>
        <!-- 弹出模具故障登记单的选择列表 -->
        <BillListPopupMouldConkBookBillVue ref="billList" :HBillType="hform.HBillType"
            :HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID">
        </BillListPopupMouldConkBookBillVue>
        <!-- 弹出模具维修记录单的选择列表 -->
        <RepairRecordPopup ref="repairRecordList" :HBillType="hform.HBillType" :HStockOrgID="hform.HStockOrgID">
        </RepairRecordPopup>
    </view>
</template>
<script>
    import dayjs from "dayjs";
    import {
        CommonUtils
    } from "@/utils/common";
    import {
        MpaasScan
    } from "@/utils/mpaasScan.js"
    import {
        getUserInfo
    } from "../../../utils/auth";
    export default {
        name: 'Sc_MouldRepairCheckBill',
        data() {
            return {
                tabs: 0,
                HMainSourceBillType: "",
                btnTop: 0,
                tabsBottom: 0,
                HModName: "Sc_MouldRepairCheckBill",
                HBillType: '3817',
                operationType: 1,
                uploadOptions: {},
                enableEdit: true,
    import dayjs from "dayjs";
    import {
        CommonUtils
    } from "@/utils/common";
    import {
        MpaasScan
    } from "@/utils/mpaasScan.js"
    import {
        getUserInfo
    } from "../../../utils/auth";
    import BillListPopupMouldConkBookBillVue from '../../../components/BillListPopup/BillListPopupMouldConkBookBill.vue';
    import RepairRecordPopup from '../../../components/BillListPopup/BillListPopuMouldRepairRecordPopup.vue';
                HDeptList: [],
                HRepairCheckList: [],
                HEmpList: [],
    export default {
        components: {
            BillListPopupMouldConkBookBillVue,
            RepairRecordPopup
        },
        name: 'Sc_MouldRepairCheckBill',
        data() {
            return {
                tabs: 0,
                btnTop: 0,
                tabsBottom: 0,
                HModName: "Sc_MouldRepairCheckBill",
                HBillType: '3817',
                operationType: 1,
                enableEdit: true,
                hform: {
                    "HBarCode": "",
                    "HBillNo": "",
                    "HInterID": 0,
                    "HDate": dayjs(new Date()).format("YYYY-MM-DD"),
                    "HInnerBillNo": "",
                    "HMouldName": "",
                    "HMouldSpec": "",
                    "HMouldModel": "",
                    "HMouldID": 0,
                    "HMainSourceBillType": "-1",
                    "HMainSourceInterID": 0,
                    "HMainSourceEntryID": 0,
                    "HCheckResult": "OK",
                    "HEmpName": getUserInfo().HEmpName,
                    "HEmpID": getUserInfo().HEmpID,
                    "HCheckBeginDate": dayjs(new Date()).format("YYYY-MM-DD"),
                    "HDeptName": getUserInfo().HDeptName,
                    "HDeptID": getUserInfo().HDeptID,
                    "HMainSourceBillNo": "",
                    "HManagerName": getUserInfo().HManagerName,
                    "HManagerID": getUserInfo().HManagerID,
                    "HMouldRepairWorkName": "",
                    "HMouldRepairWorkID": 0,
                    "HExplanation": "",
                    "HRemark": "",
                    "HOrgID": uni.getStorageSync("OrganizationID"),
                    "HMaker": getUserInfo()["Czymc"],
                    "HChecker": "",
                    "HCloseMan": "",
                    "HUpDater": "",
                    "HMakeDate": dayjs(new Date()).format("YYYY-MM-DD"),
                    "HCheckDate": "",
                    "HCloseDate": "",
                    "HUpDateDate": "",
                    "HDeleteMan": "",
                    "HDeleteDate": "",
                    "HRepairCheckMainID": 0,
                    "HRepairCheckMainContent": "",
                },
                HBillSub: [{ // 后端接口需要。否则数据不会显示在缓存中
                    "HRepairCheckID": 0,
                    "HRepairCheckCode": "",
                    "HRepairCheckName": "",
                    "HRepairCheckContent": "",
                    "HManagerID": 0,
                    "HManagerCode": "",
                    "HManagerName": "",
                    "HRemark": "",
                    "LAY_TABLE_INDEX": 0
                }]
            };
        },
        computed: {
            containerHeight: {
                get() {
                    return this.btnTop - this.tabsBottom - 5
                }
            },
        },
        methods: {
            // 提交数据有效性校验
            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
                    }
                }
                // 控制源单类型是否可编辑
                showHMainSourceBillType: true,
                HMainSourceBillType: '模具故障登记单',
                arrayHMainSourceBillType: ['模具故障登记单'],
                arrayHMainSourceBillTypeID: ['3815'],
                return {
                    Message: "",
                    state: true
                }
            },
            addNew() {
                uni.redirectTo({
                    url: './Sc_MouldRepairCheckBill?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
                }
            },
            //获取使用部门数据
            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')
                        }
                    })
                HDeptList: [],
                HRepairCheckList: [],
                HEmpList: [],
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        this.HDeptList = data
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: err
                    })
                }
            },
            // 获取职员数据
            async getEmpList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: '/PublicPageMethod/UserList',
                        data: {
                            sWhere: " where 1=1",
                        }
                    })
                hform: {
                    "HBillType": 3817,
                    "HBarCode": "",
                    "HBillNo": "",
                    "HInterID": 0,
                    "HDate": dayjs(new Date()).format("YYYY-MM-DD"),
                    "HInnerBillNo": "",
                    "HMouldName": "",
                    "HMouldSpec": "",
                    "HMouldModel": "",
                    "HMouldID": 0,
                    "HMainSourceBillType": "3815",
                    "HMainSourceInterID": 0,
                    "HMainSourceEntryID": 0,
                    "HCheckResult": "OK",
                    "HEmpName": getUserInfo().HEmpName,
                    "HEmpID": getUserInfo().HEmpID,
                    "HCheckBeginDate": dayjs(new Date()).format("YYYY-MM-DD"),
                    "HDeptName": getUserInfo().HDeptName,
                    "HDeptID": getUserInfo().HDeptID,
                    "HMainSourceBillNo": "",
                    "HManagerName": getUserInfo().HManagerName,
                    "HManagerID": getUserInfo().HManagerID,
                    "HMouldRepairWorkName": "",
                    "HMouldRepairWorkID": 0,
                    "HExplanation": "",
                    "HRemark": "",
                    "HOrgID": uni.getStorageSync("OrganizationID"),
                    "HStockOrgID": uni.getStorageSync("OrganizationID"),
                    "HMaker": getUserInfo()["Czymc"],
                    "HChecker": "",
                    "HCloseMan": "",
                    "HUpDater": "",
                    "HMakeDate": dayjs(new Date()).format("YYYY-MM-DD"),
                    "HCheckDate": "",
                    "HCloseDate": "",
                    "HUpDateDate": "",
                    "HDeleteMan": "",
                    "HDeleteDate": "",
                    "HRepairCheckMainID": 0,
                    "HRepairCheckMainContent": "",
                },
                HBillSub: [{ // 后端接口需要。否则数据不会显示在缓存中
                    "HRepairCheckID": 0,
                    "HRepairCheckCode": "",
                    "HRepairCheckName": "",
                    "HRepairCheckContent": "",
                    "HManagerID": 0,
                    "HManagerCode": "",
                    "HManagerName": "",
                    "HRemark": "",
                    "LAY_TABLE_INDEX": 0
                }]
            };
        },
        computed: {
            containerHeight: {
                get() {
                    return this.btnTop - this.tabsBottom - 5
                }
            },
        },
        methods: {
            // 提交数据有效性校验
            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
                    }
                }
                    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'),
                        }
                    })
                return {
                    Message: "",
                    state: true
                }
            },
            addNew() {
                uni.redirectTo({
                    url: './Sc_MouldRepairCheckBill?operationType=1'
                })
            },
            goBack() {
                uni.navigateBack()
            },
            showBillList() {
                this.$refs.billList.showPopup()
            },
            showRepairRecordList() {
                if (this.hform.HMouldID === 0) {
                    CommonUtils.showTips({
                        title: '提示',
                        message: '请先选择模具'
                    });
                    return;
                }
                this.$refs.repairRecordList.showPopup(this.hform.HMouldID);
            },
            //选择源单类型
            HMainSourceBillTypeChange(e) {
                if (e.detail.value == -1 || e.detail.value == NaN) {
                    this.HMainSourceBillType = '手工录入'
                    this.hform.HMainSourceBillType = -1
                    return
                }
                console.log(e.detail.value)
                console.log(e)
                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
                })
            },
            checkBoxChangeHandler(index, e) {
                let cr = e.detail.value
                if (cr.length == 0) {
                    this.HCheckFileList[index]["HDotCheckResult"] = false
                } else {
                    this.HCheckFileList[index]["HDotCheckResult"] = true
                }
            },
            //获取使用部门数据
            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.HRepairCheckList = data
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: err
                    })
                }
            },
            toScanCode() {
                MpaasScan.scanCode(cb => {
                    this.hfrom.HBarCode = cb
                    this.GetMessageByBarCode(cb)
                })
            },
            async GetMessageByBarCode(HBarCode) {
                try {
                    let res = await CommonUtils.doRequest2Sync({
                        url: "/Sc_PDA_MouldRepairCheckBill/txtHBarCode_KeyDown_List",
                        data: {
                            HBarCode: HBarCode,
                        },
                    })
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        this.HDeptList = data
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: err
                    })
                }
            },
            // 获取职员数据
            async getEmpList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: '/PublicPageMethod/UserList',
                        data: {
                            sWhere: " where 1=1",
                        }
                    })
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        this.HEmpList = data
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: err
                    })
                }
            },
            // 获取验证项目数据
            async getCheckProjList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: '/Gy_RepairCheck/GetRepairCheckList',
                        data: {
                            sWhere: "",
                            user: uni.getStorageSync('HUserName'),
                        }
                    })
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        this.HRepairCheckList = data
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: err
                    })
                }
            },
            toScanCode() {
                MpaasScan.scanCode(cb => {
                    this.hfrom.HBarCode = cb
                    this.GetMessageByBarCode(cb)
                })
            },
            async GetMessageByBarCode(HBarCode) {
                try {
                    let res = await CommonUtils.doRequest2Sync({
                        url: "/Sc_PDA_MouldRepairCheckBill/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.HMouldID = data[0].hmainid
                        this.hform.HMouldName = data[0].模具名称
                        this.hform.HMouldSpec = data[0].模具品类
                        this.hform.HMouldModel = data[0].模具型号
                        this.hform.HQty = 1
                    if (count == 1) {
                        console.log('data: ', data);
                        this.hform.HMouldID = data[0].hmainid
                        this.hform.HMouldName = data[0].模具名称
                        this.hform.HMouldSpec = data[0].模具品类
                        this.hform.HMouldModel = 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
                        }
                    })
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: err
                    })
                }
            },
            radioChange({
                detail: {
                    value
                }
            }) {
                this.hform.HCheckResult = value
            },
            async getMaxNum() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Web/GetMAXNum",
                        data: {
                            "HBillType": this.HBillType
                        }
                    })
                    let {
                        count,
                        data,
                        Message
                    } = res.data
                    console.log('data: ', data);
                    this.hform.HInterID = 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
                }
                    let {
                        count,
                        data,
                        Message
                    } = res.data
                    console.log('data: ', 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.HBillSub[0].HRepairCheckID = this.hform.HRepairCheckMainID
                    this.HBillSub[0].HManagerID = this.hform.HManagerID
                    this.HBillSub[0].HRepairCheckContent = this.hform.HRepairCheckMainContent
                    let sSubStr = JSON.stringify(this.HBillSub);
                    let sMainSub = oMain + ';' + sSubStr + ';' + getUserInfo()['Czymc'];
                    let res = await CommonUtils.doRequest2Sync({
                        url: "/Sc_MouldRepairCheckBill/SaveGetMouldRepairCheckBillList",
                        data: {
                            "msg": sMainSub
                        },
                        method: "POST"
                    })
                try {
                    let oMain = JSON.stringify(this.hform);
                    this.HBillSub[0].HRepairCheckID = this.hform.HRepairCheckMainID
                    this.HBillSub[0].HManagerID = this.hform.HManagerID
                    this.HBillSub[0].HRepairCheckContent = this.hform.HRepairCheckMainContent
                    let sSubStr = JSON.stringify(this.HBillSub);
                    let sMainSub = oMain + ';' + sSubStr + ';' + getUserInfo()['Czymc'];
                    let res = await CommonUtils.doRequest2Sync({
                        url: "/Sc_MouldRepairCheckBill/SaveGetMouldRepairCheckBillList",
                        data: {
                            "msg": sMainSub
                        },
                        method: "POST"
                    })
                    if (!res) {
                        return
                    }
                    if (!res) {
                        return
                    }
                    let {
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        uni.showModal({
                            title: '提示',
                            content: res.data.Message + '。是否继续新增?(点击取消返回上级页面)',
                            success: (res) => {
                                if (res.confirm) {
                                    console.log('用户点击确定');
                                    uni.redirectTo({
                                        url: '/pages/MJGL/Sb_EquipRepairCheck/Sb_EquipRepairCheckBill?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) {
                        uni.showModal({
                            title: '提示',
                            content: res.data.Message + '。是否继续新增?(点击取消返回上级页面)',
                            success: (res) => {
                                if (res.confirm) {
                                    console.log('用户点击确定');
                                    uni.redirectTo({
                                        url: '/pages/MJGL/Sb_EquipRepairCheck/Sb_EquipRepairCheckBill?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
                    })
                }
            }
        },
        onLoad(e) {
            console.log('e: ', e);
            if (!e.operationType) {
                this.operationType = 1
            } else {
                this.operationType = e.operationType
            }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: "提交单据失败: " + err
                    })
                }
            }
        },
        onLoad(e) {
            console.log('e: ', e);
            if (!e.operationType) {
                this.operationType = 1
            } else {
                this.operationType = e.operationType
            }
            if (this.operationType == 1) {
                // 新增
                this.getMaxNum()
            } else if (this.operationType == 2) {
                // 复制
            } else if (this.operationType == 3) {
                // 编辑
            if (this.operationType == 1) {
                // 新增
                this.getMaxNum()
            } else if (this.operationType == 2) {
                // 复制
            } else if (this.operationType == 3) {
                // 编辑
            } else if (this.operationType == 4) {
                // 浏览
            } else if (this.operationType == 4) {
                // 浏览
            }
            }
            this.getHDeptList()
            this.getEmpList()
            this.getCheckProjList()
        },
        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)
                })
        }
    }
            this.getHDeptList()
            this.getEmpList()
            this.getCheckProjList()
            // 监听故障登记单选择完成事件
            uni.$on('BillSelectComplete', (e) => {
                console.log("接收到的消息: ", e)
                this.hform.HMainSourceInterID = e.HInterID
                this.hform.HMainSourceBillNo = e.HBillNo
                this.hform.HMainSourceEntryID = e.HEntryID
                this.hform.HMouldID = e.HMouldID
                this.hform.HMouldName = e.HMouldName
                this.hform.HMouldSpec = e.HMouldSpec
                this.hform.HMouldModel = e.HMouldModel
                this.$refs.billList.exit()
            })
            // 监听维修记录选择完成事件
            uni.$on('RepairRecordSelectComplete', (e) => {
                console.log("接收到维修记录选择: ", e);
                if (e.HInterID) {
                    this.hform.HMouldRepairWorkName = e.HBillNo;
                    this.hform.HMouldRepairWorkID = e.HInterID;
                    // 可以根据需要设置其他字段
                }
                this.$refs.repairRecordList.exit();
            });
        },
        onUnload() {
            uni.$off('BillSelectComplete');
            uni.$off('RepairRecordSelectComplete');
        },
        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"
</style>
pages/MJGL/Sc_MouldRepairWorkBill/Sc_MouldRepairWorkBill.vue
@@ -306,9 +306,9 @@
                barCodeFocus: false,
                tabs: 0,
                HMainSourceBillType: '手工录入',
                arrayHMainSourceBillType: ['手工录入', '模具故障登记单'],
                arrayHMainSourceBillTypeID: ['1', '3815'],
                HMainSourceBillType: '模具故障登记单',
                arrayHMainSourceBillType: ['模具故障登记单'],
                arrayHMainSourceBillTypeID: ['3815'],
                arrayRepairType: ["内部维修", "委外维修"],
                linterid: '',
@@ -1081,13 +1081,13 @@
                                if (res.confirm) {
                                    console.log('用户点击确定');
                                    uni.redirectTo({
                                        url: '/pages/weixiujilu/mouldRepairRecordBill?OperationType=1'
                                        url: '/pages/MJGL/Sc_MouldRepairWorkBill/Sc_MouldRepairWorkBill?OperationType=1'
                                    })
                                } else if (res.cancel) {
                                    console.log('用户点击取消');
                                    // setTimeout(() => {
                                    //     uni.navigateBack();
                                    // }, 50)
                                    setTimeout(() => {
                                        uni.navigateBack();
                                    }, 50)
                                }
                            }
                        });
pages/MJGL/mujulingliaochukudan/MouldProdOutBill.vue
@@ -38,16 +38,16 @@
                </view>
            </view>
            <view class="form-item">
                <view class="title">发料:</view>
                <view class="title">发出人:</view>
                <view class="right">
                    <uni-combox :candidates="arrayHEmpName" placeholder="请输入(或扫描)发料人" v-model="hform.HKeeperName"
                    <uni-combox :candidates="arrayHEmpName" placeholder="请输入(或扫描)发出人" v-model="hform.HKeeperName"
                        @input="HScatterUserChange"></uni-combox>
                </view>
            </view>
            <view class="form-item">
                <view class="title">领料:</view>
                <view class="title">领用人:</view>
                <view class="right">
                    <uni-combox :candidates="arrayHEmpName" placeholder="请输入(或扫描)领料人" v-model="hform.HSecManagerName"
                    <uni-combox :candidates="arrayHEmpName" placeholder="请输入(或扫描)领用人" v-model="hform.HSecManagerName"
                        @input="HCollectUserChange"></uni-combox>
                </view>
            </view>
@@ -239,8 +239,8 @@
                    HWHID: getUserInfo().HWhID,
                    HStockPlaceName: getUserInfo().HSPName,
                    HStockPlaceID: getUserInfo().HSPID,
                    HKeeperName: getUserInfo().HKeeperName,
                    HKeeperID: getUserInfo().HKeeperID, //发料人
                    HKeeperName: getUserInfo().HEmpName,
                    HKeeperID: getUserInfo().HEmpID, //发料人
                    HSecManagerName: getUserInfo().HEmpName,
                    HSecManagerID: getUserInfo().HEmpID, //领料人
                    HDeptName: getUserInfo().HDeptName,
@@ -517,11 +517,6 @@
                            for (var i = 0; i < data.length; i++) {
                                this.arrayHWHName[i] = data[i]["HName"]
                            }
                        } else {
                            uni.showToast({
                                title: '仓库数据请求失败',
                                icon: 'none'
                            })
                        }
                    },
                )
@@ -543,12 +538,7 @@
                            for (var i = 0; i < data.length; i++) {
                                this.arrayHStockPlaceName[i] = data[i]["HWhName"]
                            }
                        } else {
                            uni.showToast({
                                title: '仓位数据请求失败',
                                icon: 'none'
                            })
                        }
                        }
                    },
                )
            },
pages/MJGL/mujulingliaotuikudan/Sc_MouldProdBackBill.vue
@@ -38,16 +38,16 @@
                </view>
            </view>
            <view class="form-item">
                <view class="title">发料:</view>
                <view class="title">发出人:</view>
                <view class="right">
                    <uni-combox :candidates="arrayHEmpName" placeholder="请输入(或扫描)发料人" v-model="hform.HKeeperName"
                    <uni-combox :candidates="arrayHEmpName" placeholder="请输入(或扫描)发出人" v-model="hform.HKeeperName"
                        @input="HScatterUserChange"></uni-combox>
                </view>
            </view>
            <view class="form-item">
                <view class="title">领料:</view>
                <view class="title">领用人:</view>
                <view class="right">
                    <uni-combox :candidates="arrayHEmpName" placeholder="请输入(或扫描)领料人" v-model="hform.HSecManagerName"
                    <uni-combox :candidates="arrayHEmpName" placeholder="请输入(或扫描)领用人" v-model="hform.HSecManagerName"
                        @input="HCollectUserChange"></uni-combox>
                </view>
            </view>
pages/ZLGL/QuYangHuangYang/QC_TakeSampleCheckBill/QC_TakeSampleCheckBill.vue
@@ -268,7 +268,7 @@
            let {
                operationType
            } = e
            if (operationType == 0) {
            if (operationType == 0 || operationType == 1) {
                this.getMaxNum()
                this.refSav = 'Add'
            } else {
@@ -708,10 +708,23 @@
                            Message
                        } = res.data
                        if (count == 1) {
                            return uni.showToast({
                                icon: 'none',
                                title: "提交成功!"
                            })
                            uni.showModal({
                                title: '提示',
                                content: res.data.Message + '。是否继续新增?',
                                success: (res) => {
                                    if (res.confirm) {
                                        console.log('用户点击确定');
                                        uni.redirectTo({
                                            url: '/pages/ZLGL/QuYangHuangYang/QC_TakeSampleCheckBill/QC_TakeSampleCheckBill?operationType=1'
                                        })
                                    } else if (res.cancel) {
                                        console.log('用户点击取消');
                                        setTimeout(() => {
                                            uni.navigateBack();
                                        }, 50)
                                    }
                                }
                            });
                        } else {
                            return uni.showToast({
                                icon: 'none',
@@ -723,7 +736,7 @@
            },
            onAddNewHandler() {
                uni.redirectTo({
                    url: "/pages/quyangdan/TakeSampleCheckBillList?operationType=0"
                    url: "/pages/ZLGL/QuYangHuangYang/QC_TakeSampleCheckBill/QC_TakeSampleCheckBill?operationType=1"
                })
            },
            goBack() {
pages/index/tab2.vue
@@ -257,28 +257,28 @@
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "模具报废出库单列表",
                        "text": "器具报废出库单列表",
                        "url": "/pages/MJGL/MouldScrapOutBill/MouldScrapOutBillList",
                        "id": 29,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "模具调拨单列表",
                        "text": "器具调拨单列表",
                        "url": "/pages/MJGL/qijudiaobodan/Sc_MouldMoveStockBillList",
                        "id": 30,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "模具领用出库单列表",
                        "text": "器具领用出库单列表",
                        "url": "/pages/MJGL/mujulingliaochukudan/MouldProdOutBillList",
                        "id": 31,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "模具领用退库单列表",
                        "text": "器具领用退库单列表",
                        "url": "/pages/MJGL/mujulingliaotuikudan/Sc_MouldProdBackBillList",
                        "id": 32,
                        "hidden": false
@@ -299,28 +299,28 @@
                    },
                    {
                        "img": "../../static/icon/icon5.png",
                        "text": "模具点检记录单列表",
                        "text": "器具点检记录单列表",
                        "url": "/pages/MJGL/mujudianjianjiludan/Sc_MouldDotCheckBillList",
                        "id": 35,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon5.png",
                        "text": "模具保养记录单列表",
                        "text": "器具保养记录单列表",
                        "url": "/pages/MJGL/mujubaoyangjiludan/Sc_MouldMaintainBillList",
                        "id": 36,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon13.png",
                        "text": "模具故障登记列表",
                        "text": "器具故障登记列表",
                        "url": "/pages/MJGL/Sc_MouldConkBookBill/Sc_MouldConkBookBillList",
                        "id": 37,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "模具维修派工单列表",
                        "text": "器具维修派工单列表",
                        "url": "/pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBillList",
                        "id": 38,
                        "hidden": false
@@ -328,7 +328,7 @@
                    {
                        "img": "../../static/icon/icon13.png",
                        "text": "模具维修记录列表",
                        "text": "器具维修记录列表",
                        "url": "/pages/MJGL/Sc_MouldRepairWorkBill/Sc_MouldRepairWorkBillList",
                        "id": 39,
                        "hidden": false
@@ -336,7 +336,7 @@
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "模具维修验收单列表",
                        "text": "器具维修验收单列表",
                        "url": "/pages/MJGL/SC_MouldRepairCheck/Sc_MouldRepairCheckBillList",
                        "id": 40,
                        "hidden": false
pages/index/tab3.vue
@@ -46,14 +46,14 @@
                itemData: [
                    {
                        img: '../../static/icon/icon8.png',
                        text: '模具档案查询',
                        text: '器具档案查询',
                        url: `/pages/MJGL/Gy_MouldFile/Gy_MouldFileList`,
                        id: 1,
                        hidden: false,
                    },
                    {
                        img: '../../static/icon/icon6.png',
                        text: '模具状态分析',
                        text: '器具状态分析',
                        tip: '查看详情',
                        url: '/pages/mujvzhuangtai/mujvzhuangtai',
                        id: 2,
@@ -62,63 +62,63 @@
                    },
                    {
                        img: '../../static/icon/icon16.png',
                        text: '模具寿命',
                        text: '器具寿命',
                        url: '/pages/shoujishouming/table',
                        id: 3,
                        hidden: false,
                    },
                    {
                        "img": "../../static/icon/icon13.png",
                        "text": "模具故障登记单",
                        "text": "器具故障登记单",
                        "url": "/pages/MJGL/Sc_MouldConkBookBill/Sc_MouldConkBookBill?operationType=1",
                        "id": 4,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "模具维修派工单",
                        "text": "器具维修派工单",
                        "url": "/pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBill",
                        "id": 5,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon13.png",
                        "text": "模具维修记录单",
                        "text": "器具维修记录单",
                        "url": "/pages/MJGL/Sc_MouldRepairWorkBill/Sc_MouldRepairWorkBill",
                        "id": 6,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "模具维修验收单",
                        "text": "器具维修验收单",
                        "url": "/pages/MJGL/SC_MouldRepairCheck/Sc_MouldRepairCheckBill",
                        "id": 7,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "模具点检记录单",
                        "text": "器具点检记录单",
                        "url": "/pages/MJGL/mujudianjianjiludan/Sc_MouldDotCheckBill",
                        "id": 8,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "模具保养记录单",
                        "text": "器具保养记录单",
                        "url": "/pages/MJGL/mujubaoyangjiludan/Sc_MouldMaintainBill",
                        "id": 9,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "模具领用出库单",
                        "text": "器具领用出库单",
                        "url": "/pages/MJGL/mujulingliaochukudan/MouldProdOutBill",
                        "id": 10,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "模具领用退库单",
                        "text": "器具领用退库单",
                        "url": "/pages/MJGL/mujulingliaotuikudan/Sc_MouldProdBackBill",
                        "id": 11,
                        "hidden": false
@@ -139,7 +139,7 @@
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "模具报废出库单",
                        "text": "器具报废出库单",
                        "url": "/pages/MJGL/MouldScrapOutBill/MouldScrapOutBill",
                        "id": 14,
                        "hidden": false
@@ -219,7 +219,7 @@
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "模具保养任务",
                        "text": "器具保养任务",
                        "url": "/pages/MJGL/SBMJReport/Sc_MouldMaintainTaskReport",
                        "id": 25,
                        "hidden": false
@@ -233,7 +233,7 @@
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "模具维修任务",
                        "text": "器具维修任务",
                        "url": "/pages/MJGL/Sc_MouldRepairTaskReport/Sc_MouldRepairTaskReport",
                        "id": 27,
                        "hidden": false