chenhaozhe
2026-02-05 c141b01c990146b4ef41c17a69ad3066d721a91c
pages/MJGL/Sc_MouldConkBookBill/Sc_MouldConkBookBill.vue
@@ -14,18 +14,18 @@
                            @confirm="getHBarCodeData(hform.HBarCode)" />
                    </view>
                    <uni-icons type="scan"
                       style="background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;flex-shrink: 0;"
                       size="20" @click="toScanCode"></uni-icons>
                        style="background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;flex-shrink: 0;"
                        size="20" @click="toScanCode"></uni-icons>
                </view>
            <view class="form-item" @click="searchModule">
                <view class="title">器具</view>
                <view class="righton" style="width: 350rpx;">
                    <input  placeholder="请选择器具" />
                </view>
                <uni-icons type="search"
                    style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
                    size="20" ></uni-icons>
            </view>
                <view class="form-item" @click="searchModule">
                    <view class="title">器具</view>
                    <view class="righton" style="width: 350rpx;">
                        <input placeholder="请选择器具" />
                    </view>
                    <uni-icons type="search"
                        style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
                        size="20"></uni-icons>
                </view>
                <view class="form-item">
                    <view class="title">故障发生日期</view>
@@ -180,7 +180,9 @@
        CommonUtils
    } from '../../../utils/common';
    import dayjs from 'dayjs';
    import { MpaasScan } from '../../../utils/mpaasScan';
    import {
        MpaasScan
    } from '../../../utils/mpaasScan';
    export default {
        data() {
            return {
@@ -190,7 +192,7 @@
                serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
                HModName: 'Kf_POStockInBackBill_PDA',
                ModRightName: 'CE_POStockInBack',
                OperationType: 1,
                operationType: 1,
                HInterID_Temp: '',
                showHStockPlaceName: false,
@@ -229,7 +231,7 @@
                // 提交数据
                hform: {
                    "HBarCode": "",
                    "HConkBeginDate": dayjs(new Date()).format("YYYY-MM-DD hh:mm:ss"),
                    "HConkBeginDate": dayjs(new Date()).format("YYYY-MM-DD"),
                    "HConkTypeName": "",
                    "HConkTypeID": "0",
                    "HConkReasonName": "",
@@ -237,7 +239,7 @@
                    "HExplanation": "",
                    "HBillNo": "",
                    "HInterID": "0",
                    "HDate": dayjs(new Date()).format("YYYY-MM-DD hh:mm:ss"),
                    "HDate": dayjs(new Date()).format("YYYY-MM-DD"),
                    "HDeptName": getUserInfo()["HDeptName"],
                    "HDeptID": getUserInfo()["HDeptID"],
                    "HEmpName": getUserInfo().HEmpName,
@@ -249,7 +251,7 @@
                    "HBarSpec": "",
                    "HBarModel": "",
                    "HMaker": getUserInfo()["Czymc"],
                    "HMakeDate": dayjs(new Date()).format("YYYY-MM-DD hh:mm:ss"),
                    "HMakeDate": dayjs(new Date()).format("YYYY-MM-DD"),
                    "HUpDater": "",
                    "HUpDateDate": "",
                    "HChecker": "",
@@ -269,8 +271,8 @@
        },
        async onLoad(e) {
            console.log(e, this.userInfo)
            this.OperationType = e.OperationType || 1
            if(operationType == 1) {
            this.operationType = e.operationType || 1
            if (this.operationType == 1) {
                if (e.HInterID) {
                    this.HInterID_Temp = e.HInterID
                    this.RoadBillMain(e.HInterID)
@@ -280,31 +282,35 @@
                    this.HSourceBillNoFocus = true
                    this.refreshBarCodeState()
                }
            }else if(operationType == 5) {
            } else if (this.operationType == 5) {
                // 单据下推
                let {HSourceBillType, HInterID, HBillNo} = e
                let {
                    HSourceBillType,
                    HInterID,
                    HBillNo,
                } = e
                this.getMaxNum()
                this.getSourceBillInfo(HSourceBillType, HInterID, HBillNo)
            }
            this.InitConkType()
            this.InitConkReason()
            this.InitDept()
            this.InitEmp()
        },
        methods: {
         searchModule() {
             this.$refs['billListMould'].showPopup()
         },
         MouldBillHandler(mould) {
             if(!mould.enableMultiSourceBill){
                 let val = mould.val[0]
                 this.hform.HBarCode = val['条码编号']
                 this.getHBarCodeData(this.hform.HBarCode)
             }
             this.$refs['billListMould'].exit()
         },
            searchModule() {
                this.$refs['billListMould'].showPopup()
            },
            MouldBillHandler(mould) {
                if (!mould.enableMultiSourceBill) {
                    let val = mould.val[0]
                    this.hform.HBarCode = val['条码编号']
                    this.getHBarCodeData(this.hform.HBarCode)
                }
                this.$refs['billListMould'].exit()
            },
            // 故障类别
            async InitConkType() { // 初始化故障类别
                try {
@@ -590,11 +596,11 @@
                }
            },
            // 新增回调
            addNew() {
                uni.redirectTo({
                    url: '/pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBill?OperationType=1'
                    url: '/pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBill?operationType=1'
                })
            },
            //新增
@@ -624,7 +630,7 @@
                        })
                    },
                });
            },
            },
            checkBillValidate() {
                let message = ''
@@ -636,7 +642,7 @@
                    message = '未填写部门'
                } else if (!this.hform.HEmpName) {
                    message = '未填写发现人'
                }
                }
                if (!message) {
                    return true
                }
@@ -688,12 +694,12 @@
                                if (res.confirm) {
                                    console.log('用户点击确定');
                                    uni.redirectTo({
                                        url: '/pages/MJGL/Sc_MouldConkBookBill/Sc_MouldConkBookBill?OperationType=1'
                                        url: '/pages/MJGL/Sc_MouldConkBookBill/Sc_MouldConkBookBill?operationType=1'
                                    })
                                } else if (res.cancel) {
                                    console.log('用户点击取消');
                                    setTimeout(() => {
                                       uni.navigateBack();
                                        uni.navigateBack();
                                    }, 50)
                                }
                            }
@@ -730,18 +736,23 @@
            },
            async getSourceBillInfo(HSourceBillType, HInterID, HBillNo) {
                // 下推单据类型为设备故障登记单
                if(HSourceBillType == 3815) {
                if (HSourceBillType == 3815) {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Sc_MouldConkBookBill/Sb_MouldConkBookBillListCheckDetai",
                        data: {
                            HID: HInterID
                        }
                    })
                    let {data,code, count, Message} = res.data
                    console.log('data: ',data);
                    if(code == 1) {
                        console.log('data: ',data.h_v_Sc_MouldConkBookBillList_Edit);
                    let {
                        data,
                        code,
                        count,
                        Message
                    } = res.data
                    console.log('data: ', data);
                    if (code == 1) {
                        console.log('data: ', data.h_v_Sc_MouldConkBookBillList_Edit);
                        let data1 = data.h_v_Sc_MouldConkBookBillList_Edit[0]
                        this.hform.HMainSourceBillType = HSourceBillType
                        this.HMainSourceBillType = '器具故障登记单'
@@ -754,15 +765,20 @@
                        this.hform.HMouldName = data1.产品模具
                        this.hform.HMouldModel = data1.产品模具型号
                        this.hform.HMouldSpec = data1.产品模具规格
                    }
                    else {
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: `获取源单失败: ${Message}`
                        })
                    }
                }
            }
            },
        }
    }
</script>