zrg
2025-12-25 7067d800d0d5899b67206050ce80acba9329ef7e
pages/weixiujilu/mouldRepairRecordBill.vue
@@ -17,10 +17,19 @@
                       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">
                    <view class="title">源单类型</view>
                    <view class="right" v-show="showHMainSourceBillType">
                        <picker :range="arrayHMainSourceBillType" v-model="HMainSourceBillType"
                        <picker :range="arrayHMainSourceBillType"
                            @change="HMainSourceBillTypeChange">
                            <input disabled name="HMainSourceBillType" v-model="HMainSourceBillType"
@@ -166,7 +175,7 @@
                <view class="form-item">
                    <view class="title">新设计寿命</view>
                    <view class="right">
                        <textarea v-model="hform.HNewDesignLife" style="height: 6em;" maxlength="2000"
                        <input v-model="hform.HNewDesignLife"
                            placeholder="请输入新设计寿命..." />
                    </view>
                </view>
@@ -252,6 +261,7 @@
            :HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID">
        </BillListPopupMouldConkBookBillVue>
        <BarCodePopupVue ref="barcodePopup"></BarCodePopupVue>
      <BillListPopupMouldVue @BillSelectComplete="MouldBillHandler" ref="billListMould"></BillListPopupMouldVue>
    </view>
</template>
<script>
@@ -267,11 +277,13 @@
    } from '../../utils/userRelationManager';
    import BillListPopupMouldConkBookBillVue from '../../components/BillListPopup/BillListPopupMouldConkBookBill.vue';
    import BarCodePopupVue from "../../components/BarCodePopup/BarCodePopup.vue";
   import BillListPopupMouldVue from '../../components/BillListPopup/BillListPopup_Mould.vue';
    import dayjs from 'dayjs';
    export default {
        components: {
            BarCodePopupVue,
            BillListPopupMouldConkBookBillVue
            BillListPopupMouldConkBookBillVue,
         BillListPopupMouldVue,
        },
        data() {
@@ -344,15 +356,12 @@
                    "HBillNo": "",
                    "HInterID": "0",
                    "HDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
                    "HDeptName": "",
                    "HDeptID": "0",
                    "Department": "",
                    "HEmpName": "",
                    "HEmpID": "0",
                    "HEmp": "",
                    "HManagerName": "",
                    "HManagerID": "0",
                    "HManager": "",
                    "HDeptName": getUserInfo()["HDeptName"],
                    "HDeptID": getUserInfo()["HDeptID"],
                    "HEmpName": getUserInfo().HEmpName,
                    "HEmpID": getUserInfo().HEmpID,
                    "HManagerName": getUserInfo().HSecManager,
                    "HManagerID": getUserInfo().HSecManagerID,
                    "HRepairName": "",
                    "HRepairID": "0",
                    "HRepairList": "",
@@ -362,7 +371,7 @@
                    "HSupIDList": "",
                    "HRepairType": "内部维修",
                    "HNewModel": "",
                    "HNewDesignLife": "",
                    "HNewDesignLife": "0",
                    "HBarName": "",
                    "HMouldID": "0",
                    "HBarSpec": "",
@@ -403,7 +412,7 @@
            this.InitEmp()
            this.InitSupplier()
            this.InitRepairName()
         this.loadCache()
            uni.$on('BillSelectComplete', (e) => {
                console.log("接收到的消息: ", e)
                this.hform.HMainSourceInterID = e.HInterID
@@ -420,6 +429,17 @@
            uni.$off('BillSelectComplete')
        },
        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()
         },
            // 维修项目
            async InitRepairName() { // 初始化维修项目
                try {
@@ -732,10 +752,30 @@
                    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
            })
            },
         // 读取缓存
         loadCache() {
             const pages = getCurrentPages()
             // 获取页面栈中的最后一个元素,也就是当前显示的页面
             const currentPage = pages[pages.length - 1]
             let HBillTypeCache = uni.getStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`)
             if (HBillTypeCache) {
                 this.HMainSourceBillType = HBillTypeCache.HSourceBillTypeName
                 this.hform.HMainSourceBillType = HBillTypeCache.HSourceBillType
             }
         },
            // 扫描模具条码
            async getHBarCodeData(HBarCode) {
                if (!HBarCode) {