From fd299bcb75f5b7f1dd4fd68234109f5252b27ec6 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期一, 12 一月 2026 09:51:33 +0800
Subject: [PATCH] 完善设备点检记录单 和 设备保养记录单

---
 pages/shengchanruku/ProductInCheckBill.vue               |    4 
 pages/MJGL/Sb_EquipDotCheckBill/Sb_EquipDotCheckBill.vue |  147 ++++++++++++++++++++++-------
 pages/MJGL/Sb_EquipMaintainBill/Sb_EquipMaintainBill.vue |  117 +++++++++++++----------
 pages/shengchanlingliao/PPickingCheckBill.vue            |    4 
 components/MJGL/BillSelectorPopup.vue                    |   24 +++-
 5 files changed, 201 insertions(+), 95 deletions(-)

diff --git a/components/MJGL/BillSelectorPopup.vue b/components/MJGL/BillSelectorPopup.vue
index 68053ed..51b2966 100644
--- a/components/MJGL/BillSelectorPopup.vue
+++ b/components/MJGL/BillSelectorPopup.vue
@@ -91,6 +91,10 @@
             HStockOrgID: {
                 type: [String, Number],
             },
+            Type: {
+                type: [String],
+                require: true
+            }
         },
         mounted() {},
         methods: {
@@ -123,9 +127,9 @@
                 this.getBillList()
             },
             clickCard(bill, index) {
-                console.log('this.HBillList: ',this.HBillList);
+                console.log('this.HBillList: ',this.HBillList, 'index: ', index);
                 let retVal = {}
-                retVal[this.refTargetKey] = this.HBillList[0].filter(item => item.hmainid == bill.hmainid)
+                retVal[this.refTargetKey] = bill
                 this.$emit("update", {
                     retVal: retVal,
                     index: this.refTargetKey
@@ -143,22 +147,30 @@
                 }
                 
                 if(this.refTargetKey) {
-                    sWhere += ` and 璁惧ID = ${this.refTargetKey}`
+                    // sWhere += ` and HInterID = ${this.refTargetKey}`
                 }
                 return sWhere
             },
             getBillList() {
                 let sWhere = this.getsWhere()
-                console.log('sWhere: ',sWhere);
                 this.HBillList = []
                 this.length = 0
                 this.page = 0
                 this.curPage = 1
+                let url = ""
+                if(this.Type == 'BY'){
+                    url = "/Sb_EquipMaintainRuleBill/GetEquipMaintainRuleListPDA"
+                }
+                else if (this.Type == 'DJ'){
+                    url = "/Sb_EquipDotCheckRuleBill/GetEquipDotCheckRuleListPDA"
+                }
+                else {
+                    
+                }
                 CommonUtils.doRequest(
-                    "/Web/GetEquipmentBillsList", {
+                    url, {
                         sWhere: sWhere,
                         user: getUserInfo()['Czymc'],
-                        Type: "BY"
                     },
                     (res) => {
                         let {
diff --git a/pages/MJGL/Sb_EquipDotCheckBill/Sb_EquipDotCheckBill.vue b/pages/MJGL/Sb_EquipDotCheckBill/Sb_EquipDotCheckBill.vue
index c4a1998..acd4e0e 100644
--- a/pages/MJGL/Sb_EquipDotCheckBill/Sb_EquipDotCheckBill.vue
+++ b/pages/MJGL/Sb_EquipDotCheckBill/Sb_EquipDotCheckBill.vue
@@ -156,39 +156,40 @@
                         <uni-icons type="search" size="20" @click="toCheckFile"></uni-icons>
                     </view>
                 </view>
+
+                <view class="list" v-for="(item,index) in HCheckFileList" :key="index">
+                    <uni-card style="margin: 10px;">
+                        <view class="card-detail">
+                            <view class="detail">
+                                <text>搴忓彿锛�</text>{{index+1}}
+                            </view>
+                            <view class="detail">
+                                <text>缁撴灉锛�</text>
+                                <checkbox-group style="display: inline-block;"
+                                    @change="checkBoxChangeHandler(index, $event)">
+                                    <checkbox value="enabled" :checked="item.HDotCheckResult" />
+                                </checkbox-group>
+                            </view>
+                            <view class="detail">
+                                <text>鐐规椤圭洰鍒嗙被锛�</text>{{item.HDotCheckItemClassName}}
+                            </view>
+                            <view class="detail">
+                                <text>鐐规椤圭洰锛�</text>{{item.HDotCheckItem}}
+                            </view>
+                            <view class="detail">
+                                <text>鐐规閮ㄤ綅锛�</text>{{item.HDotCheckPart}}
+                            </view>
+                            <view class="detail">
+                                <text>璐熻矗浜哄悕绉帮細</text>{{item.HManagerName}}
+                            </view>
+                            <view class="detail">
+                                <text>澶囨敞锛�</text>{{item.HRemark}}
+                            </view>
+                        </view>
+                    </uni-card>
+                </view>
+                <view class="over" v-if="HCheckFileList.length == 0">鏆傛棤鏁版嵁</view>
             </view>
-            <view class="list" v-for="(item,index) in HCheckFileList" :key="index">
-                <uni-card style="margin: 10px;">
-                    <view class="card-detail">
-                        <view class="detail">
-                            <text>搴忓彿锛�</text>{{index+1}}
-                        </view>
-                        <view class="detail">
-                            <text>缁撴灉锛�</text>
-                            <checkbox-group style="display: inline-block;"
-                                @change="checkBoxChangeHandler(index, $event)">
-                                <checkbox value="enabled" :checked="item.HDotCheckResult" />
-                            </checkbox-group>
-                        </view>
-                        <view class="detail">
-                            <text>鐐规椤圭洰鍒嗙被锛�</text>{{item.HDotCheckItemClassName}}
-                        </view>
-                        <view class="detail">
-                            <text>鐐规鏂规硶锛�</text>{{item.HDotCheckItemMethodName}}
-                        </view>
-                        <view class="detail">
-                            <text>鐐规閮ㄤ綅锛�</text>{{item.HDotCheckPart}}
-                        </view>
-                        <view class="detail">
-                            <text>璐熻矗浜哄悕绉帮細</text>{{item.HManagerName}}
-                        </view>
-                        <view class="detail">
-                            <text>澶囨敞锛�</text>{{item.HRemark}}
-                        </view>
-                    </view>
-                </uni-card>
-            </view>
-            <view class="over" v-if="HCheckFileList.length == 0">鏆傛棤鏁版嵁</view>
         </template>
         <!-- 鍏朵粬淇℃伅 -->
         <template v-if="tabs == 2">
@@ -281,6 +282,7 @@
             <button class="btn-c" size="mini" @tap="goBack">閫�鍑�</button>
         </view>
         <xe-upload ref="XeUpload" :options="uploadOptions" @callback="handleUploadCallback"></xe-upload>
+        <BillSelectorPopupVue @update="billSelectHandler" ref="billSelector" :Type="'DJ'"></BillSelectorPopupVue>
     </view>
 </template>
 
@@ -295,11 +297,12 @@
     import {
         getUserInfo
     } from "../../../utils/auth";
-    import {
-        TrackOpTypes
-    } from "vue";
+    import BillSelectorPopupVue from "../../../components/MJGL/BillSelectorPopup.vue";
     export default {
         name: 'sb_EquipDotCheckBill',
+        components: {
+            BillSelectorPopupVue
+        },
         data() {
             return {
                 tabs: 0,
@@ -382,6 +385,20 @@
 
         },
         methods: {
+            billSelectHandler(billData) {
+                console.log('billData: ', billData);
+                let data = billData.retVal[this.hform.HEquipID]
+                this.get_DocCheckItem2(data.hmainid)
+            },
+            
+            toCheckFile() {
+                if (this.hform.HEquipID == 0) {
+                    return CommonUtils.showTips({
+                        message: '涓嶈兘閫夋嫨鐐规瑙勭▼锛岃鍏堟壂鎻忚澶囨潯鐮�!!!'
+                    })
+                }
+                this.$refs['billSelector'].showPopup(this.hform.HEquipID)
+            },
             addNew() {
                 uni.redirectTo({
                     url: './Sb_EquipDotCheckBill?operationType=1'
@@ -564,6 +581,66 @@
                     })
                 }
             },
+            // 鑾峰彇淇濆吇瑙勭▼
+            async get_DocCheckItem2(HDotCheckRuleInterID) {
+                try {
+                    let res = await CommonUtils.doRequest2Async({
+                        url: "/Web/GetDotCheckRuleItemByDotCheckRuleID",
+                        data: {
+                            "HDotCheckRuleInterID": HDotCheckRuleInterID
+                        },
+                    })
+            
+                    let {
+                        data,
+                        count,
+                        Message
+                    } = res.data
+                    if (count == 1) {
+                        console.log('data: ',data);
+                        this.hform.HEquipDotCheckRuleInterID = data[0].HInterID
+                        this.hform.HEquipDotCheckRuleInterNo = data[0].HBillNo
+                        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
+                            }
+                        })
+            
+                        this.enableEdit = false
+                        this.$refs["billSelector"].exit()
+            
+                    } else {
+                        CommonUtils.showTips({
+                            message: Message
+                        })
+                    }
+                } catch (err) {
+                    CommonUtils.showTips({
+                        message: err
+                    })
+                }
+            },
             async GetItemByEquipFile() {
                 try {
                     let res = await CommonUtils.doRequest2Async({
diff --git a/pages/MJGL/Sb_EquipMaintainBill/Sb_EquipMaintainBill.vue b/pages/MJGL/Sb_EquipMaintainBill/Sb_EquipMaintainBill.vue
index b187042..a651419 100644
--- a/pages/MJGL/Sb_EquipMaintainBill/Sb_EquipMaintainBill.vue
+++ b/pages/MJGL/Sb_EquipMaintainBill/Sb_EquipMaintainBill.vue
@@ -128,39 +128,40 @@
                             <uni-icons type="search" size="20" @click="toCheckFile"></uni-icons>
                         </view>
                     </view>
+
+                    <view class="list" v-for="(item,index) in HCheckFileList" :key="index">
+                        <uni-card style="margin: 10px;">
+                            <view class="card-detail">
+                                <view class="detail">
+                                    <text>搴忓彿锛�</text>{{index+1}}
+                                </view>
+                                <view class="detail">
+                                    <text>缁撴灉锛�</text>
+                                    <checkbox-group style="display: inline-block;"
+                                        @change="checkBoxChangeHandler(index, $event)">
+                                        <checkbox value="enabled" :checked="item.HMaintainResult" />
+                                    </checkbox-group>
+                                </view>
+                                <view class="detail">
+                                    <text>淇濆吇椤圭洰锛�</text>{{item.HMaintainItem}}
+                                </view>
+                                <view class="detail" v-if="item.HMaintainPart">
+                                    <text>淇濆吇閮ㄤ綅锛�</text>{{item.HMaintainPart}}
+                                </view>
+                                <view class="detail" v-if="item.HClaim">
+                                    <text>鍏蜂綋瑕佹眰锛�</text>{{item.HClaim}}
+                                </view>
+                                <view class="detail">
+                                    <text>璐熻矗浜猴細</text>{{item.HManagerName}}
+                                </view>
+                                <view class="detail" v-if="item.Remark">
+                                    <text>澶囨敞锛�</text>{{item.Remark}}
+                                </view>
+                            </view>
+                        </uni-card>
+                    </view>
+                    <view class="over" v-if="HCheckFileList.length == 0">鏆傛棤鏁版嵁</view>
                 </view>
-                <view class="list" v-for="(item,index) in HCheckFileList" :key="index">
-                    <uni-card style="margin: 10px;">
-                        <view class="card-detail">
-                            <view class="detail">
-                                <text>搴忓彿锛�</text>{{index+1}}
-                            </view>
-                            <view class="detail">
-                                <text>缁撴灉锛�</text>
-                                <checkbox-group style="display: inline-block;"
-                                    @change="checkBoxChangeHandler(index, $event)">
-                                    <checkbox value="enabled" :checked="item.HMaintainResult" />
-                                </checkbox-group>
-                            </view>
-                            <view class="detail">
-                                <text>淇濆吇椤圭洰锛�</text>{{item.HMaintainItem}}
-                            </view>
-                            <view class="detail" v-if="item.HMaintainPart">
-                                <text>淇濆吇閮ㄤ綅锛�</text>{{item.HMaintainPart}}
-                            </view>
-                            <view class="detail" v-if="item.HClaim">
-                                <text>鍏蜂綋瑕佹眰锛�</text>{{item.HClaim}}
-                            </view>
-                            <view class="detail">
-                                <text>璐熻矗浜猴細</text>{{item.HManagerName}}
-                            </view>
-                            <view class="detail" v-if="item.Remark">
-                                <text>澶囨敞锛�</text>{{item.Remark}}
-                            </view>
-                        </view>
-                    </uni-card>
-                </view>
-                <view class="over" v-if="HCheckFileList.length == 0">鏆傛棤鏁版嵁</view>
             </view>
         </template>
         <!-- 鍏朵粬淇℃伅 -->
@@ -254,7 +255,7 @@
             <button class="btn-c" size="mini" @tap="goBack">閫�鍑�</button>
         </view>
         <xe-upload ref="XeUpload" :options="uploadOptions" @callback="handleUploadCallback"></xe-upload>
-        <BillSelectorPopupVue @update="billSelectHandler" ref="billSelector"></BillSelectorPopupVue>
+        <BillSelectorPopupVue @update="billSelectHandler" ref="billSelector" :Type="'BY'"></BillSelectorPopupVue>
     </view>
 </template>
 
@@ -359,22 +360,39 @@
         methods: {
             billSelectHandler(billData) {
                 console.log('billData: ', billData);
-                let data = billData.retVal[0]
+                let data = billData.retVal[this.hform.HEquipID]
                 this.get_DocCheckItem2(data.hmainid)
             },
             // 鑾峰彇淇濆吇瑙勭▼
             async get_DocCheckItem2(HEquipMaintainRuleInterID) {
-                try{
+                try {
                     let res = await CommonUtils.doRequest2Async({
                         url: "/Web/GetMaintainItemByMaintainRuleID",
                         data: {
                             "HEquipMaintainRuleInterID": HEquipMaintainRuleInterID
                         },
                     })
-                    
-                    let {data, count, Message} = res.data
-                    if(count == 1) {
-                        console.log('data: ',data);
+
+                    let {
+                        data,
+                        count,
+                        Message
+                    } = res.data
+                    if (count == 1) {
+                        console.log('data: ', data);
+                        this.hform.HEquipMaintainRuleInterID = data[0].淇濆吇瑙勭▼ID
+                        this.hform.HEquipMaintainRuleInterNo = data[0].淇濆吇瑙勭▼鍗曞彿
+                        this.hform.HPlanNo = data[0].淇濆吇璁″垝鍗�
+                        this.hform.HEquipMaintainPlanInterID = (data[0].淇濆吇璁″垝ID == null ? 0 : data[0].淇濆吇璁″垝ID) == "" ?
+                            0 : data[0].淇濆吇璁″垝ID
+                        this.hform.HEquipMaintainPlanEntryID = (data[0].淇濆吇璁″垝瀛怚D == null ? 0 : data[0].淇濆吇璁″垝瀛怚D) ==
+                            "" ? 0 : data[0].淇濆吇璁″垝瀛怚D
+                        this.hform.HMainSourceBillNo = data[0].淇濆吇璁″垝鍗�
+                        this.hform.HMainSourceInterID = (data[0].淇濆吇璁″垝ID == null ? 0 : data[0].淇濆吇璁″垝ID) == "" ? 0 :
+                            data[0].淇濆吇璁″垝ID
+                        this.hform.HMainSourceEntryID = (data[0].淇濆吇璁″垝瀛怚D == null ? 0 : data[0].淇濆吇璁″垝瀛怚D) == "" ? 0 :
+                            data[0].淇濆吇璁″垝瀛怚D
+                        
                         this.HCheckFileList = Array.from(data).map(item => {
                             return {
                                 "HMaintainResult": item.榛樿缁撹 == 1 ? true : false,
@@ -392,32 +410,31 @@
                                 "HSourceBillNo": item.淇濆吇璁″垝鍗� || ""
                             }
                         })
-                        
+
                         this.enableEdit = false
                         this.$refs["billSelector"].exit()
-                        
-                    }else {
+
+                    } else {
                         CommonUtils.showTips({
                             message: Message
                         })
                     }
-                }catch(err) {
+                } catch (err) {
                     CommonUtils.showTips({
                         message: err
                     })
                 }
-                
-                
-                
+
+
+
             },
             toCheckFile() {
-                if(this.hform.HEquipID == 0) {
+                if (this.hform.HEquipID == 0) {
                     return CommonUtils.showTips({
                         message: '涓嶈兘閫夋嫨淇濆吇瑙勭▼锛岃鍏堟壂鎻忚澶囨潯鐮�!!!'
                     })
                 }
-                console.log('this.$refs: ', this.$refs);
-                this.$refs['billSelector'].showPopup(0)
+                this.$refs['billSelector'].showPopup(this.hform.HEquipID)
             },
             ValidCheck() {
                 if (this.hform.HEquipID == 0) {
@@ -668,7 +685,7 @@
                     } else {
                         CommonUtils.showTips({
                             title: '娓╅Θ鎻愮ず',
-                            message: `鑾峰彇鐐规瑙勭▼閿欒锛� ${Message}`
+                            message: `鑾峰彇淇濆吇瑙勭▼閿欒锛� ${Message}`
                         })
                     }
                 } catch (err) {
diff --git a/pages/shengchanlingliao/PPickingCheckBill.vue b/pages/shengchanlingliao/PPickingCheckBill.vue
index dc5de7d..71bcaf5 100644
--- a/pages/shengchanlingliao/PPickingCheckBill.vue
+++ b/pages/shengchanlingliao/PPickingCheckBill.vue
@@ -1105,7 +1105,7 @@
             },
             addNew() {
                 uni.redirectTo({
-                    url: '/pages/xiaoshoutuihuo/PPickingBill?OperationType=1'
+                    url: './PPickingCheckBill?OperationType=1'
                 })
             },
             async submit() {
@@ -1165,7 +1165,7 @@
                                         if (res.confirm) {
                                             console.log('鐢ㄦ埛鐐瑰嚮纭畾');
                                             uni.redirectTo({
-                                                url: '/pages/xiaoshoutuihuo/PPickingBill?OperationType=1'
+                                                url: './PPickingCheckBill?OperationType=1'
                                             })
                                         } else if (res.cancel) {
                                             console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
diff --git a/pages/shengchanruku/ProductInCheckBill.vue b/pages/shengchanruku/ProductInCheckBill.vue
index ba43464..c91c584 100644
--- a/pages/shengchanruku/ProductInCheckBill.vue
+++ b/pages/shengchanruku/ProductInCheckBill.vue
@@ -950,7 +950,7 @@
             },
             addNew() {
                 uni.redirectTo({
-                    url: '/pages/shengchanruku/ProductCheckInBill?OperationType=1'
+                    url: '/pages/shengchanruku/ProductInCheckBill?OperationType=1'
                 })
             },
             async submit() {
@@ -1010,7 +1010,7 @@
                                         if (res.confirm) {
                                             console.log('鐢ㄦ埛鐐瑰嚮纭畾');
                                             uni.redirectTo({
-                                                url: '/pages/shengchanruku/ProductCheckInBill?OperationType=1'
+                                                url: '/pages/shengchanruku/ProductInCheckBill?OperationType=1'
                                             })
                                         } else if (res.cancel) {
                                             console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');

--
Gitblit v1.9.1