From 28328db7ef0b0270e9e94b6a11b32cb5f9bdac88 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期五, 06 二月 2026 13:44:07 +0800
Subject: [PATCH] Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev

---
 pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBill.vue |  424 ++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 327 insertions(+), 97 deletions(-)

diff --git a/pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBill.vue b/pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBill.vue
index cff4b33..d38816b 100644
--- a/pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBill.vue
+++ b/pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBill.vue
@@ -2,16 +2,11 @@
     <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="{
-                height: containerHeight + 'px',
-                overflow: 'auto'
-            }">
+            <view class="form" :style="{ height: containerHeight + 'px',overflow: 'auto'}">
                 <view class="form-item">
                     <view class="title">璁惧鏉$爜:</view>
                     <view :class="enableEdit?'right':'righton'">
@@ -41,9 +36,43 @@
                 <view class="form-item">
                     <view class="title">缁翠慨鍐呭:</view>
                     <view class="right">
-                        <textarea v-model="hform.HRepairContent" placeholder="璇疯緭鍏ラ獙璇佸唴瀹�" />
+                        <textarea v-model="hform.HRepairContent" placeholder="璇疯緭鍏ョ淮淇唴瀹�" />
                     </view>
                 </view>
+				<!-- 婧愬崟绫诲瀷 -->
+				<view class="form-item">
+				    <view class="title">婧愬崟绫诲瀷:</view>
+				    <view class="right" v-show="showHMainSourceBillType">
+				        <picker :range="arrayHMainSourceBillType" @change="HMainSourceBillTypeChange">
+				            <input disabled name="HMainSourceBillType" v-model="HMainSourceBillType" 
+				                   placeholder="璇烽�夋嫨婧愬崟绫诲瀷" />
+				            <view class="picker-overlay"></view>
+				        </picker>
+				    </view>
+				    <view class="righton" v-show="!showHMainSourceBillType">
+				        <input name="HMainSourceBillType" disabled v-model="HMainSourceBillType" 
+				               placeholder="璇烽�夋嫨婧愬崟绫诲瀷" />
+				    </view>
+				</view>
+				
+				<!-- 婧愬崟鍗曞彿 -->
+				<view class="form-item">
+				    <view class="title">婧愬崟鍗曞彿:</view>
+				    <view :class="enableSourceBillEdit?'right':'righton'">
+				        <input v-model="hform.HMainSourceBillNo" :disabled="!enableSourceBillEdit"
+				               @confirm="GetMessageByHMainSourceBillNo(hform.HMainSourceBillNo)" 
+				               placeholder="璇疯緭鍏�(鎴栨壂鎻�)婧愬崟鍗曞彿" />
+				    </view>
+				    <!-- 鏀惧ぇ闀滃浘鏍囷紝褰撴簮鍗曠被鍨嬩笉鏄�"鎵嬪伐褰曞叆"鏃舵樉绀� -->
+				    <view class="icon-wrapper" v-if="hform.HMainSourceBillType != '鎵嬪伐褰曞叆'">
+				        <uni-icons type="search" size="20" @click="showBillList"></uni-icons>
+				    </view>
+				    <!-- 鎵弿鍥炬爣 -->
+				    <view class="icon-wrapper">
+				        <uni-icons type="scan" size="20" @click="toScanHMainSourceBillNo"></uni-icons>
+				    </view>
+				</view>
+				
                 <view class="form-item">
                     <view class="title">鍗曟嵁鍙�:</view>
                     <view class="righton">
@@ -75,33 +104,25 @@
                     <view class="title required">缁翠慨閮ㄩ棬:</view>
                     <zxz-uni-data-select required class="right" :localdata="HDeptList" dataKey="閮ㄩ棬鍚嶇О"
                         dataValue="HItemID" v-model="hform.HDeptID">
-
                     </zxz-uni-data-select>
-                    <!-- <input disabled v-model="hform.HDeptName" placeholder="璇烽�夋嫨閮ㄩ棬" /> -->
                 </view>
                 <view class="form-item">
                     <view class="title required">缁翠慨浜�:</view>
                     <zxz-uni-data-select required class="right" :localdata="HEmpList" dataKey="HName"
                         dataValue="HItemID" v-model="hform.HEmpID">
-
                     </zxz-uni-data-select>
-                    <!-- <input disabled v-model="hform.HDeptName" placeholder="璇烽�夋嫨閮ㄩ棬" /> -->
                 </view>
                 <view class="form-item">
                     <view class="title required">缁翠慨椤圭洰:</view>
                     <zxz-uni-data-select required class="right" :localdata="HRepairList" dataKey="缁翠慨椤圭洰"
                         dataValue="hitemid" v-model="hform.HRepairID">
-
                     </zxz-uni-data-select>
-                    <!-- <input disabled v-model="hform.HDeptName" placeholder="璇烽�夋嫨閮ㄩ棬" /> -->
                 </view>
                 <view class="form-item">
                     <view class="title required">璐熻矗浜�:</view>
                     <zxz-uni-data-select required class="right" :localdata="HEmpList" dataKey="HName"
                         dataValue="HItemID" v-model="hform.HManagerID">
-
                     </zxz-uni-data-select>
-                    <!-- <input disabled v-model="hform.HDeptName" placeholder="璇烽�夋嫨閮ㄩ棬" /> -->
                 </view>
                 <view class="form-item">
                     <view class="title">璁惧鍚嶇О:</view>
@@ -201,6 +222,10 @@
             <button class="btn-c" size="mini" @tap="goBack">閫�鍑�</button>
         </view>
         <!-- <xe-upload ref="XeUpload" :options="uploadOptions" @callback="handleUploadCallback"></xe-upload> -->
+        <!-- 婧愬崟鍗曟嵁鍒楄〃寮圭獥 -->
+        <BillListPopupEquipConkBookBillVue ref="billList" :HBillType="HBillType"
+            :HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID">
+        </BillListPopupEquipConkBookBillVue>
     </view>
 </template>
 
@@ -215,13 +240,19 @@
     import {
         getUserInfo
     } from "../../../utils/auth";
+    // 寮曞叆婧愬崟鍗曟嵁鍒楄〃寮圭獥缁勪欢
+    import BillListPopupEquipConkBookBillVue from '../../../components/BillListPopup/BillListPopupEquipConkBookBill.vue';
+
     export default {
         // 璁惧缁翠慨娲惧伐鍗�
         name: 'Sb_EquipRepairSendWorkBill',
+        components: {
+            BillListPopupEquipConkBookBillVue
+        },
         data() {
             return {
                 tabs: 0,
-                HMainSourceBillType: "",
+                HMainSourceBillType: "", // 鐢ㄤ簬鏄剧ず鐨勬簮鍗曠被鍨�
                 btnTop: 0,
                 tabsBottom: 0,
                 HModName: "Sb_EquipRepairSendWorkBill",
@@ -229,6 +260,12 @@
                 operationType: 1,
                 uploadOptions: {},
                 enableEdit: true,
+                enableSourceBillEdit: true, // 淇锛氭坊鍔犺繖涓睘鎬�
+
+                // 婧愬崟绫诲瀷鐩稿叧
+                arrayHMainSourceBillType: ['璁惧缁翠慨鐧昏鍗�', '鎵嬪伐褰曞叆'], // 鍙�夌殑婧愬崟绫诲瀷
+                arrayHMainSourceBillTypeID: ['璁惧缁翠慨鐧昏鍗�', '鎵嬪伐褰曞叆'], // 瀵瑰簲鐨勫崟鎹被鍨婭D
+                showHMainSourceBillType: true,
 
                 HDeptList: [],
                 HRepairCheckList: [],
@@ -242,12 +279,12 @@
                     HDate: dayjs(new Date()).format("YYYY-MM-DD"),
                     HInnerBillNo: '',
                     HRepairContent: '',
-                    HDeptIDName: '',
-                    HDeptID: 0,
-                    HEmpIDName: '',
-                    HEmpID: 0,
-                    HManagerIDName: '',
-                    HManagerID: 0,
+                    HDeptName: getUserInfo().HDeptName,
+                    HDeptID: getUserInfo().HDeptID,
+                    HEmpName: getUserInfo().HEmpName,
+                    HEmpID: getUserInfo().HEmpID,
+                    HManagerName: getUserInfo().HManagerName,
+                    HManagerID: getUserInfo().HManagerID,
                     HEquipIDName: '',
                     HEquipID: 0,
                     HRepairIDName: '',
@@ -255,7 +292,7 @@
                     HRepairPlanBeginDate: dayjs(new Date()).format("YYYY-MM-DD"),
                     HRepairPlanEndDate: dayjs(new Date()).format("YYYY-MM-DD"),
                     HCycleUnit: '灏忔椂',
-                    HPlanTimes: '',
+                    HPlanTimes: '0',
                     HExplanation: '',
                     HRemark: '',
                     HMaker: getUserInfo()["Czymc"],
@@ -267,7 +304,13 @@
                     HCloseDate: '',
                     HUpDateDate: '',
                     HDeleteMan: '',
-                    HDeleteDate: ''
+                    HDeleteDate: '',
+                    // 鏂板鐨勬簮鍗曠浉鍏冲瓧娈�
+                    HMainSourceBillType: '-1', // 榛樿涓鸿澶囩淮淇櫥璁板崟
+                    HMainSourceBillNo: '',
+                    HMainSourceInterID: 0,
+                    HMainSourceEntryID: 0,
+                    HStockOrgID: uni.getStorageSync("OrganizationID"), // 鏂板搴撳瓨缁勭粐ID
                 },
                 HDetailList: [{ // 鍚庣鎺ュ彛鎻愪氦闇�瑕� 鏄庣粏淇℃伅
                     "瀛愮淮淇」鐩�": "",
@@ -289,6 +332,168 @@
             },
         },
         methods: {
+            // 鏄剧ず婧愬崟鍗曟嵁鍒楄〃寮圭獥
+            showBillList() {
+                if (this.hform.HMainSourceBillType === '鎵嬪伐褰曞叆') {
+                    CommonUtils.showTips({
+                        title: '鎻愮ず',
+                        message: '鎵嬪伐褰曞叆妯″紡涓嬩笉鑳介�夋嫨婧愬崟'
+                    });
+                    return;
+                }
+                this.$refs.billList.showPopup();
+            },
+
+            // 閫夋嫨婧愬崟绫诲瀷
+            HMainSourceBillTypeChange(e) {
+                if (e.detail.value == -1 || e.detail.value == NaN) {
+                    this.HMainSourceBillType = '鎵嬪伐褰曞叆';
+                    this.hform.HMainSourceBillType = '鎵嬪伐褰曞叆';
+                    return;
+                }
+
+                this.HMainSourceBillType = this.arrayHMainSourceBillType[e.detail.value];
+                this.hform.HMainSourceBillType = this.arrayHMainSourceBillTypeID[e.detail.value];
+
+                // 濡傛灉鏄墜宸ュ綍鍏ワ紝娓呯┖婧愬崟淇℃伅
+                if (this.hform.HMainSourceBillType === '鎵嬪伐褰曞叆') {
+                    this.hform.HMainSourceBillNo = '';
+                    this.hform.HMainSourceInterID = 0;
+                    this.hform.HMainSourceEntryID = 0;
+                    this.enableSourceBillEdit = false; // 鎵嬪伐褰曞叆鏃剁鐢ㄦ簮鍗曞崟鍙风紪杈�
+                } else {
+                    this.enableSourceBillEdit = true; // 闈炴墜宸ュ綍鍏ユ椂鍙紪杈�
+                }
+
+                // 缂撳瓨褰撳墠椤甸潰閫夋嫨
+                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;
+                    
+                    // 鏍规嵁缂撳瓨鐨勬簮鍗曠被鍨嬭缃紪杈戠姸鎬�
+                    if (this.hform.HMainSourceBillType === '鎵嬪伐褰曞叆') {
+                        this.enableSourceBillEdit = false;
+                    } else {
+                        this.enableSourceBillEdit = true;
+                    }
+                }
+            },
+
+            // 鎵弿婧愬崟鍗曞彿
+            toScanHMainSourceBillNo() {
+                MpaasScan.scanCode(cb => {
+                    this.hform.HMainSourceBillNo = cb;
+                    this.GetMessageByHMainSourceBillNo(cb);
+                });
+            },
+
+            // 鏍规嵁婧愬崟鍗曞彿鑾峰彇淇℃伅
+            async GetMessageByHMainSourceBillNo(HSouceBillNo) {
+                try {
+                    let url, dataField;
+                    
+                    // 鏍规嵁婧愬崟绫诲瀷閫夋嫨涓嶅悓鐨勬帴鍙�
+                    if (this.hform.HMainSourceBillType === '璁惧缁翠慨鐧昏鍗�') {
+                        url = "/Sb_EqpRepairWorkBill/GetEqpConkBookBillListPage";
+                        dataField = {
+                            sWhere: ` and 鍗曟嵁鍙� = '${HSouceBillNo}'`,
+                            user: getUserInfo()["Czymc"],
+                            page: 1,
+                            size: 1,
+                        };
+                    } else {
+                        CommonUtils.showTips({
+                            title: "娓╅Θ鎻愮ず",
+                            message: `鏆備笉鏀寔璇ユ簮鍗曠被鍨嬶細${this.hform.HMainSourceBillType}`
+                        });
+                        return;
+                    }
+
+                    let res = await CommonUtils.doRequest2Async({
+                        url: url,
+                        data: dataField
+                    });
+
+                    let { count, Message, data } = res.data;
+                    if (count == 1) {
+                        this.hform.HMainSourceBillNo = data[0]["鍗曟嵁鍙�"];
+                        this.hform.HMainSourceInterID = data[0]["hmainid"];
+                        this.hform.HMainSourceEntryID = data[0]["hsubid"];
+                        
+                        // 濡傛灉婧愬崟鏈夎澶囦俊鎭紝鍙互鑷姩濉厖
+                        if (data[0].HEquipID) {
+                            this.hform.HEquipID = data[0].HEquipID;
+                            this.getEquipFileMain(data[0].HEquipID);
+                        }
+
+                    } else {
+                        CommonUtils.showTips({
+                            title: "娓╅Θ鎻愮ず",
+                            message: `鑾峰彇婧愬崟鍗曞彿澶辫触: ${Message}`
+                        });
+                    }
+                } catch (err) {
+                    CommonUtils.showTips({
+                        title: "娓╅Θ鎻愮ず",
+                        message: `鑾峰彇婧愬崟鍗曞彿澶辫触: ${err}`
+                    });
+                }
+            },
+
+            // 鏍规嵁璁惧ID鑾峰彇璁惧淇℃伅
+            async getEquipFileMain(HInterID) {
+                try {
+                    let res = await CommonUtils.doRequest2Sync({
+                        url: "/Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_ListByHEquipID",
+                        data: {
+                            HEquipID: HInterID,
+                        },
+                    });
+
+                    if (!res) {
+                        return;
+                    }
+
+                    let {
+                        data,
+                        count,
+                        Message
+                    } = res.data;
+
+                    if (count == 1) {
+                        this.hform.HEquipID = data[0].hmainid;
+                        this.hform.HBarName = data[0].璁惧鍚嶇О;
+                        this.hform.HBarSpec = data[0].璁惧瑙勬牸;
+                        this.hform.HBarModel = data[0].璁惧鍨嬪彿;
+                        this.hform.HBarCode = data[0].璁惧鏉$爜 || "";
+                        this.enableEdit = false;
+                    } else {
+                        CommonUtils.showTips({
+                            title: "娓╅Θ鎻愮ず",
+                            message: Message
+                        });
+                    }
+                } catch (err) {
+                    CommonUtils.showTips({
+                        title: "娓╅Θ鎻愮ず",
+                        message: err
+                    });
+                }
+            },
+
             // 缁翠慨椤圭洰
             async getRepairList() {
                 try{ 
@@ -336,13 +541,13 @@
                 }
                 if (this.hform.HEmpID == 0) {
                     return {
-                        Message: "楠屾敹浜轰笉寰椾负绌�!",
+                        Message: "缁翠慨浜轰笉寰椾负绌�!",
                         state: false
                     }
                 }
-                if (this.hform.HRepairCheckMainID == 0) {
+                if (this.hform.HRepairID == 0) {
                     return {
-                        Message: "楠岃瘉椤圭洰涓嶅緱涓虹┖!",
+                        Message: "缁翠慨椤圭洰涓嶅緱涓虹┖!",
                         state: false
                     }
                 }
@@ -350,6 +555,15 @@
                     return {
                         Message: "璐熻矗浜轰笉寰椾负绌�!",
                         state: false
+                    }
+                }
+                // 娣诲姞婧愬崟鏍¢獙锛堝鏋滀笉鏄墜宸ュ綍鍏ワ紝鍒欏繀椤婚�夋嫨婧愬崟锛�
+                if (this.hform.HMainSourceBillType !== '鎵嬪伐褰曞叆') {
+                    if (!this.hform.HMainSourceBillNo || this.hform.HMainSourceBillNo.trim() === '') {
+                        return {
+                            Message: "婧愬崟绫诲瀷闈炴墜宸ュ綍鍏ワ紝蹇呴』閫夋嫨婧愬崟锛�",
+                            state: false
+                        }
                     }
                 }
 
@@ -463,7 +677,7 @@
                     let res = await CommonUtils.doRequest2Async({
                         url: '/Gy_Department/list',
                         data: {
-                            sWhere: "",
+                            sWhere: ` and HUSEORGID = ${uni.getStorageSync('OrganizationID')} `,
                             user: uni.getStorageSync('HUserName'),
                             Organization: uni.getStorageSync('Organization')
                         }
@@ -492,10 +706,14 @@
             // 鑾峰彇鑱屽憳鏁版嵁
             async getEmpList() {
                 try {
+                    let sWhere=  " where 1=1 "
+                    if(this.hform.HDeptName && uni.getStorageSync("Organization") == '瀹佹尝甯傚崕鑸熷寘瑁呮湁闄愬叕鍙�'){
+                        sWhere += ` and HDeptName = '${this.hform.HDeptName}'`
+                    }
                     let res = await CommonUtils.doRequest2Async({
                         url: '/PublicPageMethod/UserList',
                         data: {
-                            sWhere: " where 1=1",
+                            sWhere: sWhere,
                         }
                     })
 
@@ -552,7 +770,7 @@
             },
             toScanCode() {
                 MpaasScan.scanCode(cb => {
-                    this.hfrom.HBarCode = cb
+                    this.hform.HBarCode = cb; // 淇锛氬師鏉ユ槸 hfrom 搴旇鏄� hform
                     this.GetMessageByBarCode(cb)
                 })
             },
@@ -564,7 +782,6 @@
                             HBarCode: HBarCode,
                         },
                     })
-
 
                     if (!res) {
                         return
@@ -582,6 +799,7 @@
                         this.hform.HBarName = data[0].璁惧鍚嶇О
                         this.hform.HBarSpec = data[0].璁惧瑙勬牸
                         this.hform.HBarModel = data[0].璁惧鍨嬪彿
+                        this.hform.HBarCode = HBarCode; // 纭繚鏉$爜姝g‘鏄剧ず
                         this.hform.HQty = 1
 
                         this.enableEdit = false
@@ -598,66 +816,7 @@
                         message: err
                     })
                 }
-            },
-            async GetItemByEquipFile() {
-                try {
-                    let res = await CommonUtils.doRequest2Async({
-                        url: "/Web/GetItemByEquipFile",
-                        data: {
-                            "EquipProjectID": this.hform.HEquipID,
-                            "Type": "DJ",
-                            "HDate": this.hform.HBeginDate
-                        }
-                    })
-
-                    let {
-                        data,
-                        Message,
-                        count
-                    } = res.data
-                    if (count == 1) {
-                        this.hform.HEquipDotCheckRuleInterID = data[0].鐐规瑙勭▼ID
-                        this.hform.HEquipDotCheckRuleInterNo = data[0].鐐规瑙勭▼鍗曞彿
-                        this.hform.HPlanNo = data[0].鐐规璁″垝鍗�
-                        this.hform.HPlanInterID = (data[0].鐐规璁″垝ID == null ? 0 : data[0].鐐规璁″垝ID) == "" ? 0 : data[0]
-                            .鐐规璁″垝ID
-                        this.hform.HPlanEntryID = (data[0].鐐规璁″垝瀛怚D == null ? 0 : data[0].鐐规璁″垝瀛怚D) == "" ? 0 : data[
-                            0].鐐规璁″垝瀛怚D
-
-                        this.HCheckFileList = Array.from(data).map(item => {
-                            return {
-                                "HDotCheckItemID": item.HDotCheckItemID,
-                                "HDotCheckCode": item.鐐规椤圭洰浠g爜,
-                                "HDotCheckItem": item.鐐规椤圭洰,
-                                "HDotCheckPart": item.鐐规閮ㄤ綅,
-                                "HClaim": item.鍏蜂綋瑕佹眰,
-                                "HManagerID": item.璐熻矗浜篒D,
-                                "HManagerCode": item.璐熻矗浜轰唬鐮�,
-                                "HManagerName": item.璐熻矗浜哄悕绉�,
-                                "HSourceInterID": item.鐐规璁″垝ID == null ? 0 : item.鐐规璁″垝ID,
-                                "HSourceEntryID": item.鐐规璁″垝瀛怚D == null ? 0 : item.鐐规璁″垝瀛怚D,
-                                "HSourceBillNo": item.鐐规璁″垝鍗�,
-                                "HDotCheckItemClassID": 0,
-                                "HDotCheckItemClassName": "",
-                                "HDotCheckItemMethodID": 0,
-                                "HDotCheckItemMethodName": "",
-                                "HDotCheckResult": item.榛樿缁撹 == 1 ? true : false
-                            }
-                        })
-
-                    } else {
-                        CommonUtils.showTips({
-                            title: '娓╅Θ鎻愮ず',
-                            message: `鑾峰彇鐐规瑙勭▼閿欒锛� ${Message}`
-                        })
-                    }
-                } catch (err) {
-                    CommonUtils.showTips({
-                        title: '娓╅Θ鎻愮ず',
-                        message: `鑾峰彇鐐规瑙勭▼閿欒锛� ${err}`
-                    })
-                }
-            },
+            },          
             radioChange({
                 detail: {
                     value
@@ -702,8 +861,12 @@
                     let oMain = JSON.stringify(this.hform);
                     this.HDetailList[0].HManagerID = this.hform.HManagerID
                     this.HDetailList[0].HRepairID = this.hform.HRepairID
+                    let oprType = this.operationType
+                    if(oprType == 4){
+                        oprType = 1
+                    }
                     let sSubStr = JSON.stringify(this.HDetailList);
-                    let sMainSub = oMain + ';' + sSubStr + `;-1;${this.operationType}` + ';' + getUserInfo()[
+                    let sMainSub = oMain + ';' + sSubStr + `;-1;${oprType}` + ';' + getUserInfo()[
                     'Czymc'];
                     let res = await CommonUtils.doRequest2Sync({
                         url: "/Sb_EquipRepairSendWorkBill/AddEquipRepairSendWorkBill",
@@ -746,12 +909,48 @@
                         })
                     }
 
-
                 } catch (err) {
                     CommonUtils.showTips({
                         title: "娓╅Θ鎻愮ず",
                         message: "鎻愪氦鍗曟嵁澶辫触: " + err
                     })
+                }
+            },
+            async getSourceBillInfo(HSourceBillType, HInterID, HBillNo) {
+                // 涓嬫帹鍗曟嵁绫诲瀷涓鸿澶囨晠闅滅櫥璁板崟
+                if(HSourceBillType == 3907) {
+                    let res = await CommonUtils.doRequest2Async({
+                        url: "/Sb_EqpRepairWorkBill/Sb_EqpConkBookBillListCheckDetai",
+                        data: {
+                            HID: HInterID
+                        }
+                    })
+                    
+                    let {data,code, count, Message} = res.data
+                    
+                    if(code == 1) {
+                        console.log('data: ',data.h_v_Sb_EquipConkBookBillList_Edit);
+                        let data1 = data.h_v_Sb_EquipConkBookBillList_Edit[0]
+                        this.hform.HMainSourceBillType = HSourceBillType
+                        this.HMainSourceBillType = '璁惧鏁呴殰鐧昏鍗�'
+                        this.hform.HMainSourceBillNo = data1.鍗曟嵁鍙�
+                        this.hform.HMainSourceInterID = data1.hmainid
+                        this.hform.HMainSourceEntryID = data1.hsubid
+                        this.hform.HEquipID = data1.HEquipID
+                        this.hform.HManagerName = data1.璐熻矗浜�
+                        this.hform.HManagerID = data1.HManagerID
+                        this.hform.HBarName = data1.璁惧鍚嶇О
+                        this.hform.HBarModel = data1.璁惧鍨嬪彿
+                        this.hform.HBarSpec = data1.璁惧瑙勬牸
+                        this.hform.HRepairContent = data1.鏁呴殰鎻忚堪
+                        
+                    }
+                    else {
+                        CommonUtils.showTips({
+                            title: '娓╅Θ鎻愮ず',
+                            message: `鑾峰彇婧愬崟澶辫触: ${Message}`
+                        })
+                    }
                 }
             }
         },
@@ -770,16 +969,38 @@
                 // 澶嶅埗
             } else if (this.operationType == 3) {
                 // 缂栬緫
-
             } else if (this.operationType == 4) {
-                // 娴忚
-
+                let {HSourceBillType, HInterID, HBillNo} = e
+                // 涓嬫帹
+                // this.enableEdit = false;
+                // this.enableSourceBillEdit = false;
+                // this.showHMainSourceBillType = false;
+                this.getMaxNum()
+                this.getSourceBillInfo(HSourceBillType, HInterID, HBillNo)
             }
 
             this.getHDeptList()
             this.getEmpList()
             this.getCheckProjList()
             this.getRepairList()
+            this.loadCache()
+
+            // 鐩戝惉鍗曟嵁閫夋嫨瀹屾垚浜嬩欢
+            uni.$on('BillSelectComplete', (e) => {
+                console.log("鎺ユ敹鍒扮殑娑堟伅: ", e)
+                this.hform.HMainSourceInterID = e.HInterID
+                this.hform.HMainSourceBillNo = e.HBillNo
+                this.hform.HMainSourceEntryID = e.HEntryID
+                this.hform.HEquipID = e.HEquipID
+                this.hform.HBarName = e.HEquipName
+                this.hform.HBarSpec = e.HEquipSpec
+                this.hform.HBarModel = e.HEquipModel
+                this.hform.HBarCode = e.HEquipBarCode || ""
+                this.$refs.billList.exit()
+            })
+        },
+        onUnload() {
+            uni.$off('BillSelectComplete')
         },
         onReady() {
             const query = uni.createSelectorQuery().in(this)
@@ -796,5 +1017,14 @@
 </script>
 
 <style lang="scss" scoped>
-    @import "@/pages/MJGL/style/MJBillStyle.scss"
+    @import "@/pages/MJGL/style/MJBillStyle.scss";
+    
+    .picker-overlay {
+        position: absolute;
+        top: 0;
+        left: 0;
+        right: 0;
+        bottom: 0;
+        z-index: 1;
+    }
 </style>
\ No newline at end of file

--
Gitblit v1.9.1