From 673f7a65d555188d4effe22359994342d8ceda33 Mon Sep 17 00:00:00 2001
From: wangyi <2946747746@qq.com>
Date: 星期二, 03 三月 2026 14:42:40 +0800
Subject: [PATCH] 环境检测单

---
 components/ZLGL/CheckSchemePopup.vue              |  320 ++++++++++++++++++++++++++++++++
 utils/WebSocketServices.js                        |    4 
 components/ZLGL/CheckEnvironmentTestItemPopup.vue |  265 ++++++++++++++++++++++++++
 .hbuilderx/launch.json                            |    4 
 4 files changed, 589 insertions(+), 4 deletions(-)

diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json
index 49a12f7..74bdda1 100644
--- a/.hbuilderx/launch.json
+++ b/.hbuilderx/launch.json
@@ -22,11 +22,11 @@
             "type" : "uni-app:app-ios"
         },
         {
-            "customPlaygroundType" : "local",
+            "customPlaygroundType" : "device",
             "localRepoPath" : "C:/Users/19858/Desktop/鏅轰簯杩堟��/APP/STUWMS/unpackage/debug",
             "openVueDevtools" : true,
             "packageName" : "com.iflytek.inputmethod",
-            "playground" : "custom",
+            "playground" : "standard",
             "type" : "uni-app:app-android"
         }
     ]
diff --git a/components/ZLGL/CheckEnvironmentTestItemPopup.vue b/components/ZLGL/CheckEnvironmentTestItemPopup.vue
new file mode 100644
index 0000000..c770e63
--- /dev/null
+++ b/components/ZLGL/CheckEnvironmentTestItemPopup.vue
@@ -0,0 +1,265 @@
+<template>
+    <view>
+        <uni-popup ref="popup" type="bottom" @change="popupChangeHandler">
+            <view class="content">
+                <view class="search-condition">
+                    <view class="title"><text>鐜妫�娴嬮」鐩唬鐮�: </text></view>
+                    <view class="right"><input type="text" v-model="HCode" @confirm="getBillList" /></view>
+                </view>
+                <view class="search-condition">
+                    <view class="title"><text>鐜妫�娴嬮」鐩悕绉�: </text></view>
+                    <view class="right"><input type="text" v-model="HName" @confirm="getBillList" /></view>
+                </view>
+                <view class="buttons">
+                    <button size="mini" type="primary" @click="search">鏌ヨ</button>
+                    <view style="flex: 1;"></view>
+                    <button size="mini" type="primary" @click="exit">閫�鍑�</button>
+                </view>
+                <scroll-view id="#BillListPanel" scroll-y="true" style="height: 55vh;">
+                    <view class="options-wrapper" v-show="HBillList.length != 0">
+                        <uni-card :is-active="bill.isActive" :class="bill.isActive?'uni-card--is-active':''"
+                            v-for="(bill, index) in HBillList[curPage-1]" :key="index" :title="bill['鐜妫�娴嬮」鐩悕绉�']" :extra="`${bill['鐜妫�娴嬮」鐩唬鐮�']}`"
+                            @tap="clickCard(bill, index)">
+                            <view class="item">
+                                <view class="left">鐜妫�娴嬮」鐩悕绉�: </view>
+                                <view class="right">{{bill['鐜妫�娴嬮」鐩悕绉�']}}</view>
+                            </view>
+                            <view class="item">
+                                <view class="left">鐜妫�娴嬮」鐩唬鐮�: </view>
+                                <view class="right">{{bill['鐜妫�娴嬮」鐩唬鐮�']}}</view>
+                            </view>
+                            <view class="item">
+                                <view class="left">绂佺敤鏍囪: </view>
+                                <view class="right">{{bill['绂佺敤鏍囪']}}</view>
+                            </view>
+                            <view class="item">
+                                <view class="left">澶囨敞: </view>
+                                <view class="right">{{bill['澶囨敞']}}</view>
+                            </view>
+                            <view class="item">
+                                <view class="left">浣跨敤缁勭粐: </view>
+                                <view class="right">{{bill['浣跨敤缁勭粐']}}</view>
+                            </view>
+                        </uni-card>
+                    </view>
+                    <view class="over" v-show="HBillList.length == 0">鏆傛棤鏁版嵁</view>
+                </scroll-view>
+                <uni-pagination id="#pagination" title="鏍囬鏂囧瓧" v-model="curPage" :pageSize="size"
+                    :total="length"></uni-pagination>
+            </view>
+
+        </uni-popup>
+    </view>
+</template>
+
+<script>
+    import dayjs from 'dayjs';
+    import {
+        CommonUtils
+    } from '@/utils/common';
+    import {
+        getUserInfo
+    } from '@/utils/auth';
+    export default {
+        name: "SampleSchemePopup",
+        emits: ["update:modelValue"],
+        data() {
+            return {
+                dayjs: dayjs,
+                enablefocus: false,
+                size: 20,
+                curPage: 1,
+                length: 0,
+                page: 0,
+                HName: '',
+                HCode: '',
+                HBillList: [],
+                panelHeight: 0,
+
+                multiSouceBillList: []
+            };
+        },
+        props: {
+            bindKey: {
+                type: [String, Number],
+                required: true
+            },
+            HStockOrgID: {
+                type: [String, Number],
+            },
+        },
+        methods: {
+            popupChangeHandler(e) {
+                if (e.show === true) {
+                    this.getBillList()
+                }
+            },
+            async exit() {
+                this.size = 20
+                this.curPage = 1
+                this.length = 0
+                this.page = 0
+                this.HSourceBillNo = ''
+                this.HMater = ''
+                this.HCustom = ''
+                this.HBillList = []
+                this.enablefocus = false
+                this.multiSouceBillList = []
+                // 闇�瑕佺瓑寰呴〉闈㈠唴鐨勬暟鎹祴鍊煎畬姣�
+                await this.$nextTick()
+                this.$refs.popup.close();
+            },
+            search() {
+                this.getBillList()
+            },
+            showPopup() {
+                this.$refs.popup.open();
+            },
+            clickCard(bill, index) {
+                let retVal = {}
+                retVal[this.bindKey] = bill
+                console.log('retVal: ', retVal);
+                this.$emit("update", {
+                    retVal: retVal
+                })
+            },
+            getsWhere() {
+                let sWhere = ` and 绂佺敤鏍囧織 !='鏄�' and  ISNULL(瀹℃牳浜�,'')!=''  and HUSEORGID = '${ uni.getStorageSync("OrganizationID")}'`
+
+               if (this.HCode) {
+                   swhere += ` and 鐜妫�娴嬮」鐩唬鐮� like '%${this.HCode}%'`
+               }
+               if (this.HName) {
+                   swhere += ` and 鐜妫�娴嬮」鐩悕绉� like '%${this.HName}%'`
+               }
+                return sWhere
+            },
+            getBillList() {
+                this.HBillList = []
+                this.length = 0
+                this.page = 0
+                this.curPage = 1
+                CommonUtils.doRequest(
+                    "/Gy_BadReason/Gy_EnvironmentTestItemList", {
+                        sWhere: this.getsWhere(),
+                        user: getUserInfo()['Czymc']
+                    },
+                    (res) => {
+                        let {
+                            data,
+                            count,
+                            Message
+                        } = res.data
+                        if (count == 1) {
+                            this.length = Array.from(data).length
+                            const result = [];
+                            for (let i = 0; i < data.length; i += this.size) {
+                                result.push(data.slice(i, i + this.size));
+                            }
+                            this.HBillList = result
+                            this.page = result.length
+                            setTimeout(() => {
+                                this.enablefocus = true
+                            }, 500)
+                        } else {
+                            setTimeout(() => {
+                                this.enablefocus = true
+                            }, 500)
+                            uni.showToast({
+                                icon: 'none',
+                                title: Message
+                            })
+                        }
+                    }
+                )
+            },
+        },
+    }
+</script>
+
+<style lang="scss">
+    .content {
+        box-sizing: border-box;
+        border-radius: 15rpx 15rpx 0 0;
+        padding: 20rpx 20rpx 40rpx 20rpx;
+        background-color: #fff;
+        display: flex;
+        flex-direction: column;
+        gap: 10rpx;
+
+        .search-condition {
+            display: flex;
+            flex-direction: row;
+            align-items: center;
+            gap: 20rpx;
+            font-size: 30rpx;
+
+            .title {
+                width: 5rem;
+                text-align: right;
+            }
+
+            .right {
+                flex: 1;
+                border-radius: 22rpx;
+                border: 1px solid #acacac;
+                height: auto;
+                padding: 8rpx 16rpx;
+
+                input {
+                    width: 100%;
+                    font-size: 30rpx;
+                }
+            }
+        }
+
+        .buttons {
+            display: flex;
+            flex-direction: row;
+            gap: 20rpx;
+            justify-content: flex-end;
+
+            >button {
+                display: inline-flex;
+                width: 4rem;
+            }
+        }
+
+        .options-wrapper {
+            padding: 20rpx;
+            display: grid;
+            grid-template-columns: repeat(1, 1fr);
+            gap: 20rpx;
+
+            >view {
+                margin: 0 !important;
+                box-sizing: border-box;
+
+            }
+
+            .item {
+                .left {
+                    display: inline-block;
+                    width: 6rem;
+                }
+
+                .right {
+                    display: inline-block;
+                }
+            }
+        }
+
+        .uni-card--is-active {
+            background-color: rgba(0, 122, 255, 0.2);
+        }
+
+        .daterange {
+            display: flex;
+            flex-direction: row;
+            gap: 10rpx;
+            justify-content: center;
+            align-items: center;
+
+        }
+    }
+</style>
\ No newline at end of file
diff --git a/components/ZLGL/CheckSchemePopup.vue b/components/ZLGL/CheckSchemePopup.vue
new file mode 100644
index 0000000..6173b49
--- /dev/null
+++ b/components/ZLGL/CheckSchemePopup.vue
@@ -0,0 +1,320 @@
+<template>
+    <view>
+        <uni-popup ref="popup" type="bottom" @change="popupChangeHandler">
+            <view class="content">
+                <view class="search-condition">
+                    <view class="title"><text>鍗曟嵁鍙�: </text></view>
+                    <view class="right"><input type="text" v-model="HCode" @confirm="getBillList" /></view>
+                </view>
+                <view class="search-condition">
+                    <view class="title"><text>妫�娴嬮」鐩�: </text></view>
+                    <view class="right"><input type="text" v-model="HName" @confirm="getBillList" /></view>
+                </view>
+                <view class="buttons">
+                    <button size="mini" type="primary" @click="search">鏌ヨ</button>
+                    <view style="flex: 1;"></view>
+                    <button size="mini" type="primary" @click="exit">閫�鍑�</button>
+                </view>
+                <scroll-view id="#BillListPanel" scroll-y="true" style="height: 55vh;">
+                    <view class="options-wrapper" v-show="HBillList.length != 0">
+                        <uni-card :is-active="bill.isActive" :class="bill.isActive?'uni-card--is-active':''"
+                            v-for="(bill, index) in HBillList[curPage-1]" :key="index" :title="bill['鍗曟嵁鍙�']" :extra="`${bill['妫�娴嬮」鐩�']}`"
+                            @tap="clickCard(bill, index)">
+                            <view class="item">
+                                <view class="left">鍗曟嵁鍙�: </view>
+                                <view class="right">{{bill['鍗曟嵁鍙�']}}</view>
+                            </view>
+                            <view class="item">
+                                <view class="left">妫�娴嬮」鐩�: </view>
+                                <view class="right">{{bill['妫�娴嬮」鐩�']}}</view>
+                            </view>
+                            <view class="item">
+                                <view class="left">鐩爣鍊�: </view>
+                                <view class="right">{{bill['鐩爣鍊�']}}</view>
+                            </view>
+                            <view class="item">
+                                <view class="left">涓婇檺鍊�: </view>
+                                <view class="right">{{bill['涓婇檺鍊�']}}</view>
+                            </view>
+                            <view class="item">
+                                <view class="left">涓嬮檺鍊�: </view>
+                                <view class="right">{{bill['涓嬮檺鍊�']}}</view>
+                            </view>
+                            <view class="item">
+                                <view class="left">琛ㄥご澶囨敞: </view>
+                                <view class="right">{{bill['琛ㄥご澶囨敞']}}</view>
+                            </view>
+                        </uni-card>
+                    </view>
+                    <view class="over" v-show="HBillList.length == 0">鏆傛棤鏁版嵁</view>
+                </scroll-view>
+                <uni-pagination id="#pagination" title="鏍囬鏂囧瓧" v-model="curPage" :pageSize="size"
+                    :total="length"></uni-pagination>
+            </view>
+
+        </uni-popup>
+    </view>
+</template>
+
+<script>
+    import dayjs from 'dayjs';
+    import {
+        CommonUtils
+    } from '@/utils/common';
+    import {
+        getUserInfo
+    } from '@/utils/auth';
+    export default {
+        name: "SampleSchemePopup",
+        emits: ["update:modelValue"],
+        data() {
+            return {
+                dayjs: dayjs,
+                enablefocus: false,
+                size: 20,
+                curPage: 1,
+                length: 0,
+                page: 0,
+                HName: '',
+                HCode: '',
+                HBillList: [],
+                panelHeight: 0,
+
+                multiSouceBillList: []
+            };
+        },
+        props: {
+            bindKey: {
+                type: [String, Number],
+                required: true
+            },
+            HStockOrgID: {
+                type: [String, Number],
+            },
+        },
+        methods: {
+            popupChangeHandler(e) {
+                if (e.show === true) {
+                    this.getBillList()
+                }
+            },
+            async exit() {
+                this.size = 20
+                this.curPage = 1
+                this.length = 0
+                this.page = 0
+                this.HSourceBillNo = ''
+                this.HMater = ''
+                this.HCustom = ''
+                this.HBillList = []
+                this.enablefocus = false
+                this.multiSouceBillList = []
+                // 闇�瑕佺瓑寰呴〉闈㈠唴鐨勬暟鎹祴鍊煎畬姣�
+                await this.$nextTick()
+                this.$refs.popup.close();
+            },
+            search() {
+                this.getBillList()
+            },
+            showPopup() {
+                this.$refs.popup.open();
+            },
+           async clickCard(bill, index) {
+               try {
+                   // 鏄剧ず鍔犺浇鎻愮ず
+                   uni.showLoading({
+                       title: '鍔犺浇涓�...'
+                   });
+                   
+                   console.log('閫変腑鐨勪富琛ㄦ暟鎹�:', bill);
+                   
+                   // 浣跨敤鍚屼竴涓帴鍙o紝浣嗛�氳繃鍗曟嵁鍙锋煡璇㈡墍鏈夌浉鍏虫暟鎹�
+                   let res = await CommonUtils.doRequest2Async({
+                       url: "/Gy_BaseInformation/get锘縂y_EnvironmentTestSchemeBillMainList",
+                       data: {
+                           sWhere: ` and 鍗曟嵁鍙� = '${bill.鍗曟嵁鍙穧'`,  // 鏍规嵁鍗曟嵁鍙锋煡璇㈡墍鏈夎褰�
+                           user: getUserInfo()['Czymc']
+                       }
+                   });
+                   
+                   let { data, count, Message } = res.data;
+                   console.log('鏌ヨ缁撴灉:', data);
+                   
+                   if (count == 1 && data && data.length > 0) {
+                       // 杩斿洖璇ヤ富琛ㄤ笅鐨勬墍鏈夊瓙琛ㄦ暟鎹紙鐩稿悓鍗曟嵁鍙风殑鎵�鏈夎褰曪級
+                       let retVal = {};
+                       
+                       // 灏嗘墍鏈夋暟鎹斁鍏ヨ繑鍥炲璞′腑
+                       data.forEach((item, index) => {
+                           retVal[index] = item;
+                       });
+                       
+                       console.log('杩斿洖鐨勬墍鏈夋暟鎹�: ', retVal);
+                       
+                       this.$emit("update", {
+                           retVal: retVal
+                       });
+                       
+                       // 鍏抽棴寮圭獥
+                       this.exit();
+                       
+                       uni.showToast({
+                           title: `宸插姞杞� ${data.length} 鏉℃暟鎹甡,
+                           icon: 'success'
+                       });
+                   } else {
+                       uni.showToast({
+                           title: '鏈壘鍒版暟鎹�',
+                           icon: 'none'
+                       });
+                   }
+               } catch (err) {
+                   console.error('鍔犺浇鏁版嵁澶辫触:', err);
+                   uni.showToast({
+                       title: '鍔犺浇澶辫触',
+                       icon: 'none'
+                   });
+               } finally {
+                   uni.hideLoading();
+               }
+           },
+            getsWhere() {
+                let sWhere = `  and  ISNULL(瀹℃牳浜�,'')!=''  and HOrgID = '${ uni.getStorageSync("OrganizationID")}'`
+
+               if (this.HCode) {
+                   sWhere += ` and 鍗曟嵁鍙� like '%${this.HCode}%'`
+               }
+               if (this.HName) {
+                   sWhere += ` and 妫�娴嬮」鐩� like '%${this.HName}%'`
+               }
+                return sWhere
+            },
+            getBillList() {
+                this.HBillList = []
+                this.length = 0
+                this.page = 0
+                this.curPage = 1
+                CommonUtils.doRequest(
+                    "/Gy_BaseInformation/get锘縂y_EnvironmentTestSchemeBillMainList", {
+                        sWhere: this.getsWhere(),
+                        user: getUserInfo()['Czymc']
+                    },
+                    (res) => {
+                        let {
+                            data,
+                            count,
+                            Message
+                        } = res.data
+                        if (count == 1) {
+                            this.length = Array.from(data).length
+                            const result = [];
+                            for (let i = 0; i < data.length; i += this.size) {
+                                result.push(data.slice(i, i + this.size));
+                            }
+                            this.HBillList = result
+                            this.page = result.length
+                            setTimeout(() => {
+                                this.enablefocus = true
+                            }, 500)
+                        } else {
+                            setTimeout(() => {
+                                this.enablefocus = true
+                            }, 500)
+                            uni.showToast({
+                                icon: 'none',
+                                title: Message
+                            })
+                        }
+                    }
+                )
+            },
+        },
+    }
+</script>
+
+<style lang="scss">
+    .content {
+        box-sizing: border-box;
+        border-radius: 15rpx 15rpx 0 0;
+        padding: 20rpx 20rpx 40rpx 20rpx;
+        background-color: #fff;
+        display: flex;
+        flex-direction: column;
+        gap: 10rpx;
+
+        .search-condition {
+            display: flex;
+            flex-direction: row;
+            align-items: center;
+            gap: 20rpx;
+            font-size: 30rpx;
+
+            .title {
+                width: 5rem;
+                text-align: right;
+            }
+
+            .right {
+                flex: 1;
+                border-radius: 22rpx;
+                border: 1px solid #acacac;
+                height: auto;
+                padding: 8rpx 16rpx;
+
+                input {
+                    width: 100%;
+                    font-size: 30rpx;
+                }
+            }
+        }
+
+        .buttons {
+            display: flex;
+            flex-direction: row;
+            gap: 20rpx;
+            justify-content: flex-end;
+
+            >button {
+                display: inline-flex;
+                width: 4rem;
+            }
+        }
+
+        .options-wrapper {
+            padding: 20rpx;
+            display: grid;
+            grid-template-columns: repeat(1, 1fr);
+            gap: 20rpx;
+
+            >view {
+                margin: 0 !important;
+                box-sizing: border-box;
+
+            }
+
+            .item {
+                .left {
+                    display: inline-block;
+                    width: 6rem;
+                }
+
+                .right {
+                    display: inline-block;
+                }
+            }
+        }
+
+        .uni-card--is-active {
+            background-color: rgba(0, 122, 255, 0.2);
+        }
+
+        .daterange {
+            display: flex;
+            flex-direction: row;
+            gap: 10rpx;
+            justify-content: center;
+            align-items: center;
+
+        }
+    }
+</style>
\ No newline at end of file
diff --git a/utils/WebSocketServices.js b/utils/WebSocketServices.js
index c1a0526..f083872 100644
--- a/utils/WebSocketServices.js
+++ b/utils/WebSocketServices.js
@@ -98,7 +98,7 @@
                 // 澶勭悊涓氬姟娑堟伅
                 if (message.Type === "MessageUnRead") { // 鏈娑堟伅
                     let payload = {
-                        pagePath: "/pages/ZLGL/OA_WorkLink/OA_WorkLinkBillList",
+                        pagePath: "/pages/ZLGL/OA_WorkLink/OA_WorkLinkBillQuery",
                         itemId: 0
                     }
                     const content = JSON.parse(message.Content);
@@ -107,7 +107,7 @@
                 } else if (message.Type === "Message") {
                     const content = JSON.parse(message.Content)
                     let payload = {
-                        pagePath: "/pages/ZLGL/OA_WorkLink/OA_WorkLinkBillList",
+                        pagePath: "/pages/ZLGL/OA_WorkLink/OA_WorkLinkBillQuery",
                         itemId: 0
                     }
                     this.showTaskTip(content[0]["鍐呭"], payload, content[0]["涓婚"]);

--
Gitblit v1.9.1