From 423c1948a631cff298e6348cc55626f5149c111a Mon Sep 17 00:00:00 2001
From: qq_41295110 <qq_41295110@noreply.gitcode.com>
Date: 星期四, 26 二月 2026 13:10:19 +0800
Subject: [PATCH] Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev

---
 pages/MJGL/Sb_EquipRepairCheckBill/Sb_EquipRepairCheckBill.vue |  368 ++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 272 insertions(+), 96 deletions(-)

diff --git a/pages/MJGL/Sb_EquipRepairCheckBill/Sb_EquipRepairCheckBill.vue b/pages/MJGL/Sb_EquipRepairCheckBill/Sb_EquipRepairCheckBill.vue
index cfbeb05..468dcc6 100644
--- a/pages/MJGL/Sb_EquipRepairCheckBill/Sb_EquipRepairCheckBill.vue
+++ b/pages/MJGL/Sb_EquipRepairCheckBill/Sb_EquipRepairCheckBill.vue
@@ -42,9 +42,26 @@
                     </view>
                 </view>
                 <view class="form-item">
-                    <view class="title">楠岃瘉鍐呭:</view>
+                    <view class="title">楠屾敹鍐呭:</view>
                     <view class="right">
-                        <textarea v-model="hform.HRepairCheckMainContent" placeholder="璇疯緭鍏ラ獙璇佸唴瀹�" />
+                        <textarea v-model="HDetailList[0].HRepairCheckContent" placeholder="璇疯緭鍏ラ獙鏀跺唴瀹�" />
+                    </view>
+                </view>
+                <!-- 缁翠慨璁板綍锛堟簮鍗曪級 -->
+                <view class="form-item">
+                    <view class="title required">缁翠慨璁板綍:</view>
+                    <view :class="enableSourceBillEdit?'right':'righton'">
+                        <input v-model="hform.HMainSourceBillNo" :disabled="!enableSourceBillEdit"
+                            @confirm="GetMessageByHMainSourceBillNo(hform.HMainSourceBillNo)"
+                            placeholder="璇疯緭鍏�(鎴栨壂鎻�)缁翠慨璁板綍鍗曞彿" />
+                    </view>
+                    <!-- 鏀惧ぇ闀滃浘鏍� -->
+                    <view class="icon-wrapper">
+                        <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">
@@ -63,33 +80,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>
+                    <view class="title">楠屾敹椤圭洰:</view>
                     <zxz-uni-data-select required class="right" :localdata="HRepairCheckList" dataKey="缁翠慨楠屾敹椤圭洰"
-                        dataValue="hitemid" v-model="hform.HRepairCheckMainID">
-
+                        dataValue="hitemid" v-model="hform.HRepairCheckID">
                     </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>
@@ -176,6 +185,11 @@
             <button class="btn-c" size="mini" @tap="goBack">閫�鍑�</button>
         </view>
         <xe-upload ref="XeUpload" :options="uploadOptions" @callback="handleUploadCallback"></xe-upload>
+
+        <!-- 婧愬崟鍗曟嵁鍒楄〃寮圭獥 -->
+        <BillListPopupEquipConkBookBillVue ref="billList" :HBillType="hform.HBillType" :HSourceBillType="'璁惧缁翠慨璁板綍鍗�'"
+            :HStockOrgID="hform.HStockOrgID">
+        </BillListPopupEquipConkBookBillVue>
     </view>
 </template>
 
@@ -190,12 +204,17 @@
     import {
         getUserInfo
     } from "../../../utils/auth";
+    // 寮曞叆婧愬崟鍗曟嵁鍒楄〃寮圭獥缁勪欢
+    import BillListPopupEquipConkBookBillVue from '../../../components/BillListPopup/BillListPopupEquipConkBookBill.vue';
+
     export default {
         name: 'sb_EquipRepairCheckBill',
+        components: {
+            BillListPopupEquipConkBookBillVue
+        },
         data() {
             return {
                 tabs: 0,
-                HMainSourceBillType: "",
                 btnTop: 0,
                 tabsBottom: 0,
                 HModName: "sb_EquipRepairCheckBill",
@@ -203,33 +222,35 @@
                 operationType: 1,
                 uploadOptions: {},
                 enableEdit: true,
+                enableSourceBillEdit: true, // 鏂板锛氭帶鍒剁淮淇褰曠紪杈戠姸鎬�
 
                 HDeptList: [],
                 HRepairCheckList: [],
                 HEmpList: [],
 
                 hform: {
+                    "HBillType": '3911',
                     "HBarCode": "",
-                    "HCheckBeginDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
+                    "HCheckBeginDate": dayjs(new Date()).format("YYYY-MM-DD"),
                     "HCheckResult": "OK",
-                    "HRepairCheckMainContent": "",
+                    "HRepairCheckContent": "",
                     "HBillNo": "",
                     "HInterID": 0,
-                    "HDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
-                    "HDeptName": "",
-                    "HDeptID": 0,
-                    "HEmpName": "",
-                    "HEmpID": 0,
+                    "HDate": dayjs(new Date()).format("YYYY-MM-DD"),
+                    "HDeptName": getUserInfo().HDeptName,
+                    "HDeptID": getUserInfo().HDeptID,
+                    "HEmpName": getUserInfo().HEmpName,
+                    "HEmpID": getUserInfo().HEmpID,
+                    "HManagerName": getUserInfo().HManagerName,
+                    "HManagerID": getUserInfo().HManagerID,
                     "HRepairCheckMainName": "",
-                    "HRepairCheckMainID": 0,
-                    "HManagerName": "",
-                    "HManagerID": 0,
+                    "HRepairCheckID": 0,
                     "HBarName": "",
                     "HEquipID": 0,
                     "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": "",
@@ -237,16 +258,23 @@
                     "HDeleteMan": "",
                     "HDeleteDate": "",
                     "lngBillKey": "",
-                    "lngBillSubKey": ""
+                    "lngBillSubKey": "",
+                    // 鏂板锛氱淮淇褰曪紙婧愬崟锛夌浉鍏冲瓧娈�
+                    "HMainSourceBillNo": "",
+                    "HMainSourceInterID": 0,
+                    "HMainSourceEntryID": 0,
+                    "HMouldRepairWorkName": "",
+                    "HMouldRepairWorkID": 0,
+                    "HStockOrgID": uni.getStorageSync("OrganizationID"),
                 },
-                HBillSub: [{ // 鍚庣鎺ュ彛闇�瑕併�傚惁鍒欐暟鎹笉浼氭樉绀哄湪缂撳瓨涓�
-                    "HRepairID": 0,
+                HDetailList: [{ // 鍚庣鎺ュ彛鎻愪氦闇�瑕� 鏄庣粏淇℃伅
+                    "HRepairCheckID": 0,
                     "HRepairCode": "",
                     "HRepairName": "",
                     "HManagerID": 0,
                     "HManagerCode": "",
                     "HManagerName": "",
-                    "HRepairExplanation": "",
+                    "HRepairCheckContent": "",
                     "HRemark": "",
                     "LAY_TABLE_INDEX": 0
                 }]
@@ -260,6 +288,106 @@
             },
         },
         methods: {
+            // 鏄剧ず婧愬崟鍗曟嵁鍒楄〃寮圭獥
+            showBillList() {
+                this.$refs.billList.showPopup();
+            },
+
+            // 鎵弿缁翠慨璁板綍鍗曞彿
+            toScanHMainSourceBillNo() {
+                MpaasScan.scanCode(cb => {
+                    this.hform.HMainSourceBillNo = cb;
+                    this.GetMessageByHMainSourceBillNo(cb);
+                });
+            },
+
+            // 鏍规嵁缁翠慨璁板綍鍗曞彿鑾峰彇淇℃伅
+            async GetMessageByHMainSourceBillNo(HSouceBillNo) {
+                try {
+                    let url = "/Sb_EqpRepairWorkBill/GetEqpRepairWorkBillListPage";
+                    let dataField = {
+                        sWhere: ` and 鍗曟嵁鍙� = '${HSouceBillNo}'`,
+                        user: getUserInfo()["Czymc"],
+                        page: 1,
+                        size: 1,
+                    };
+
+                    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
+                    });
+                }
+            },
+
             // 鎻愪氦鏁版嵁鏈夋晥鎬ф牎楠�
             ValidCheck() {
                 if (this.hform.HEquipID == 0) {
@@ -280,7 +408,7 @@
                         state: false
                     }
                 }
-                if (this.hform.HRepairCheckMainID == 0) {
+                if (this.hform.HRepairCheckID == 0) {
                     return {
                         Message: "楠岃瘉椤圭洰涓嶅緱涓虹┖!",
                         state: false
@@ -289,6 +417,13 @@
                 if (this.hform.HManagerID == 0) {
                     return {
                         Message: "璐熻矗浜轰笉寰椾负绌�!",
+                        state: false
+                    }
+                }
+                // 鏂板锛氱淮淇褰曟牎楠�
+                if (!this.hform.HMainSourceBillNo || this.hform.HMainSourceBillNo.trim() === '') {
+                    return {
+                        Message: "缁翠慨璁板綍涓嶅緱涓虹┖!",
                         state: false
                     }
                 }
@@ -432,10 +567,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,
                         }
                     })
 
@@ -492,7 +631,7 @@
             },
             toScanCode() {
                 MpaasScan.scanCode(cb => {
-                    this.hfrom.HBarCode = cb
+                    this.hform.HBarCode = cb; // 淇锛氬師鏉ユ槸 hfrom 搴旇鏄� hform
                     this.GetMessageByBarCode(cb)
                 })
             },
@@ -504,7 +643,6 @@
                             HBarCode: HBarCode,
                         },
                     })
-
 
                     if (!res) {
                         return
@@ -522,6 +660,7 @@
                         this.hform.HBarName = data[0].璁惧鍚嶇О
                         this.hform.HBarSpec = data[0].璁惧瑙勬牸
                         this.hform.HBarModel = data[0].璁惧鍨嬪彿
+                        this.hform.HBarCode = HBarCode;
                         this.hform.HQty = 1
 
                         this.enableEdit = false
@@ -536,65 +675,6 @@
                     CommonUtils.showTips({
                         title: "娓╅Θ鎻愮ず",
                         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}`
                     })
                 }
             },
@@ -629,6 +709,73 @@
                     })
                 }
             },
+            async getSendWorkBill(HSendWorkID) {
+                try{
+                    let res = await CommonUtils.doRequest2Async({
+                        url: "/Sb_EquipRepairSendWorkBill/GetEquipRepairSendWorkBillList",
+                        data: {
+                            sWhere: ` and hmainid ='${HSendWorkID}' `,
+                            user: getUserInfo()["Czymc"]
+                        }
+                    })
+                    
+                    let {data, count, Message} = res.data
+                    if(count == 1) {
+                        this.hform.HRepairCheckID = this.HRepairCheckList.find(item => data[0]["琛ㄤ綋缁翠慨椤圭洰"] == item["缁翠慨楠屾敹椤圭洰"])?.hitemid
+                        this.HDetailList[0].HRepairCheckContent = data[0].缁翠慨鍐呭
+                    }else {
+                       CommonUtils.showTips({
+                           title: "娓╅Θ鎻愮ず",
+                           message: `鑾峰彇娲惧伐鍗曞け璐�: ${Message}`
+                       }) 
+                    }
+                }catch(err) {
+                    CommonUtils.showTips({
+                        title: "娓╅Θ鎻愮ず",
+                        message: `鑾峰彇娲惧伐鍗曞け璐�: ${err}`
+                    })
+                }
+            },
+            async getSourceBillInfo(HSourceBillType, HInterID, HBillNo, HSendWorkID) {
+                // 涓嬫帹鍗曟嵁绫诲瀷涓鸿澶囨晠闅滅櫥璁板崟
+                if (HSourceBillType == 3907) {
+                    let res = await CommonUtils.doRequest2Async({
+                        url: "/Sb_EqpRepairWorkBill/GetEquipMatainanceBillBySourceInterID",
+                        data: {
+                            user: getUserInfo()["Czymc"],
+                            HSourceInterID: HInterID
+                        }
+                    })
+
+                    let {
+                        data,
+                        code,
+                        count,
+                        Message
+                    } = res.data
+
+                    if (count == 1) {
+                        console.log('data: ', data);
+                        let data1 = data[0]
+                        this.hform.HEquipID = data[0].HEquipID
+                        this.hform.HBarName = data[0].璁惧鍚嶇О
+                        this.hform.HBarModel = data[0].璁惧瑙勬牸
+                        this.hform.HBarSpec = data[0].璁惧瑙勬牸
+                        
+                        this.hform.HMainSourceBillNo = data[0]["璁惧缁翠慨璁板綍鍗�"];
+                        this.hform.HMainSourceInterID = data[0]["HEquipRepairCheckBillInterID"];
+                        this.hform.HMainSourceEntryID = data[0]["HEquipRepairCheckBillEntryID"];
+                        this.hform.HManagerID = data[0]["HManagerID"];
+                        this.hform.HEmpID = data[0]["HEmpID"];
+                        this.getSendWorkBill(HSendWorkID)
+                    } else {
+                        CommonUtils.showTips({
+                            title: '娓╅Θ鎻愮ず',
+                            message: `鑾峰彇婧愬崟澶辫触: ${Message}`
+                        })
+                    }
+                }
+            },
             async submit() {
                 let valid = this.ValidCheck()
                 if (!valid.state) {
@@ -640,7 +787,9 @@
 
                 try {
                     let oMain = JSON.stringify(this.hform);
-                    let sSubStr = JSON.stringify(this.HBillSub);
+                    this.HDetailList[0].HManagerID = this.hform.HManagerID
+                    this.HDetailList[0].HRepairCheckID = this.hform.HRepairCheckID
+                    let sSubStr = JSON.stringify(this.HDetailList);
                     let sMainSub = oMain + ';' + sSubStr + ';' + getUserInfo()['Czymc'];
                     let res = await CommonUtils.doRequest2Sync({
                         url: "/Sb_EqpRepairWorkBill/SaveGetEqpRepairCheckBillList",
@@ -683,7 +832,6 @@
                         })
                     }
 
-
                 } catch (err) {
                     CommonUtils.showTips({
                         title: "娓╅Θ鎻愮ず",
@@ -703,19 +851,47 @@
             if (this.operationType == 1) {
                 // 鏂板
                 this.getMaxNum()
+                this.enableEdit = true;
+                this.enableSourceBillEdit = true;
             } else if (this.operationType == 2) {
                 // 澶嶅埗
             } else if (this.operationType == 3) {
                 // 缂栬緫
-
             } else if (this.operationType == 4) {
-                // 娴忚
-
+                // 涓嬫帹
+                let {
+                    HSourceBillType,
+                    HInterID,
+                    HBillNo,
+                    HSendWorkID
+                } = e
+                // 涓嬫帹
+                this.getMaxNum()
+                this.getSourceBillInfo(HSourceBillType, HInterID, HBillNo, HSendWorkID)
             }
 
             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.HMouldRepairWorkID = e.HInterID
+                this.hform.HMouldRepairWorkName = e.HBillNo
+                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)

--
Gitblit v1.9.1