From 7bd57821164a2036cb6669d8b45a8ff0976a0b84 Mon Sep 17 00:00:00 2001
From: chenhaozhe <gaozhechen26@gmail.com>
Date: 星期四, 30 十月 2025 21:14:48 +0800
Subject: [PATCH] 新增 检验方案 弹窗

---
 pages/ZLGL/shoujianjianyan/form.vue   |  109 ++++++++++++++-
 components/ZLGL/CheckProjectPopup.vue |  305 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 405 insertions(+), 9 deletions(-)

diff --git a/components/ZLGL/CheckProjectPopup.vue b/components/ZLGL/CheckProjectPopup.vue
new file mode 100644
index 0000000..0fb9d35
--- /dev/null
+++ b/components/ZLGL/CheckProjectPopup.vue
@@ -0,0 +1,305 @@
+<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="daterange" style="flex: 1;">
+                        <view class="right general">
+                            <uni-datetime-picker type="date" :clear-icon="false" v-model="HBeginDate">
+                                <view>{{HBeginDate}}</view>
+                            </uni-datetime-picker>
+                        </view>
+                        <view>鈥�</view>
+                        <view class="right general">
+                            <uni-datetime-picker type="date" :clear-icon="false" v-model="HEndDate">
+                                <view>{{HEndDate}}</view>
+                            </uni-datetime-picker>
+                        </view>
+                    </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['妫�楠屾柟妗堝悕绉�']"
+                            @tap="clickCard(bill, index)">
+                            <view class="item" v-if="bill['鍗曟嵁鍙�']">
+                                <view class="left">鍗曟嵁鍙�: </view>
+                                <view class="right">{{bill['鍗曟嵁鍙�']}}</view>
+                            </view>
+                            <view class="item" v-if="bill['鏃ユ湡']">
+                                <view class="left">鏃ユ湡: </view>
+                                <view class="right">{{dayjs(bill['鏃ユ湡']).format("YYYY-MM-DD")}}</view>
+                            </view>
+                            <view class="item" v-if="bill['閮ㄩ棬鍚嶇О']">
+                                <view class="left">閮ㄩ棬鍚嶇О: </view>
+                                <view class="right">{{bill['閮ㄩ棬鍚嶇О']}}</view>
+                            </view>
+                            <view class="item" v-if="bill['宸ュ簭鍚嶇О']">
+                                <view class="left">宸ュ簭鍚嶇О: </view>
+                                <view class="right">{{bill['宸ュ簭鍚嶇О']}}</view>
+                            </view>
+                            <view class="item" v-if="bill['鐗╂枡浠g爜']">
+                                <view class="left">鐗╂枡浠g爜: </view>
+                                <view class="right">{{bill['鐗╂枡浠g爜']}}</view>
+                            </view>
+                            <view class="item" v-if="bill['鐗╂枡鍚嶇О']">
+                                <view class="left">鐗╂枡鍚嶇О: </view>
+                                <view class="right">{{bill['鐗╂枡鍚嶇О']}}</view>
+                            </view>
+                            <view class="item" v-if="bill['瑙勬牸鍨嬪彿']">
+                                <view class="left">瑙勬牸鍨嬪彿: </view>
+                                <view class="right">{{bill['瑙勬牸鍨嬪彿']}}</view>
+                            </view>
+                            <view class="item" v-if="bill['鐗╂枡澶х被浠g爜']">
+                                <view class="left">鐗╂枡澶х被浠g爜: </view>
+                                <view class="right">{{bill['鐗╂枡澶х被浠g爜']}}</view>
+                            </view>
+                            <view class="item" v-if="bill['鐗╂枡澶х被鍚嶇О']">
+                                <view class="left">鐗╂枡澶х被鍚嶇О: </view>
+                                <view class="right">{{bill['鐗╂枡澶х被鍚嶇О']}}</view>
+                            </view>
+                            <view class="item" v-if="bill['鐢熶骇璧勬簮']">
+                                <view class="left">鐢熶骇璧勬簮: </view>
+                                <view class="right">{{bill['鐢熶骇璧勬簮']}}</view>
+                            </view>
+                            <view class="item" v-if="bill['榛樿鏂规']">
+                                <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,
+                HProcessName: '',
+                HMaterName: '',
+                HBeginDate: dayjs(new Date()).subtract(30, 'd').format("YYYY-MM-DD"),
+                HEndDate: dayjs(new Date()).format("YYYY-MM-DD"),
+                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 ISNULL(瀹℃牳浜�,'')!=''  and HOrgID  = '${ uni.getStorageSync("OrganizationID")}'`
+                if (this.HBeginDate && this.HEndDate) {
+                    sWhere += ` and  CONVERT(varchar(100),鏃ユ湡, 23) between '${this.HBeginDate}' and '${this.HEndDate}'`
+                }
+
+                if (this.HMaterName && this.HProcessName) {
+                    sWhere += ` and 鐗╂枡鍚嶇О = '${this.HMaterName}' and 宸ュ簭鍚嶇О = '${this.HProcessName}'`
+                }
+                return sWhere
+            },
+            getBillList() {
+                this.HBillList = []
+                this.length = 0
+                this.page = 0
+                this.curPage = 1
+                CommonUtils.doRequest(
+                    "/QC_Management/MES_QC_CheckProjectList_Json_Main", {
+                        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
+                            })
+                        }
+                    }
+                )
+            },
+            setRequiredInfo(MaterName, ProcessName) {
+                this.HMaterName = MaterName || ""
+                this.HProcessName = ProcessName || ""
+            }
+        },
+    }
+</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/pages/ZLGL/shoujianjianyan/form.vue b/pages/ZLGL/shoujianjianyan/form.vue
index a22e945..69b40bb 100644
--- a/pages/ZLGL/shoujianjianyan/form.vue
+++ b/pages/ZLGL/shoujianjianyan/form.vue
@@ -94,7 +94,7 @@
                     <view class="form-item">
                         <view class="left">妫�楠屾柟妗�</view>
                         <view class="right disabled">
-                            <input type="text" disabled value="" />
+                            <input type="text" disabled :value="this.hform.HQCSchemeName" />
                         </view>
                         <view class="icon-wrapper-big"><uni-icons type="search" size="20"
                                 @click="showSelectorModule(hform, 7)"></uni-icons></view>
@@ -395,10 +395,12 @@
         </MaterialPopupVue>
         <ICMOBillPopupVue v-if="enablePopupModule == PopupModuleNameList[5]" ref="listPopup" @update="ICMOBillComplete"
             :bindKey="0"></ICMOBillPopupVue>
-        <ProcExchBillPopupVue v-if="enablePopupModule == PopupModuleNameList[6]" ref="listPopup" @update="ProcExchBillComplete"
-            :bindKey="0"></ProcExchBillPopupVue>
+        <ProcExchBillPopupVue v-if="enablePopupModule == PopupModuleNameList[6]" ref="listPopup"
+            @update="ProcExchBillComplete" :bindKey="0"></ProcExchBillPopupVue>
         <ProcessPopupVue v-if="enablePopupModule == PopupModuleNameList[8]" ref="listPopup" @update="HProcComplete"
             :bindKey="0"></ProcessPopupVue>
+        <CheckProjectPopupVue v-if="enablePopupModule == PopupModuleNameList[7]" ref="listPopup"
+            @update="HQCSchemeComplete" :bindKey="0"></CheckProjectPopupVue>
     </view>
 </template>
 
@@ -415,6 +417,7 @@
     import ICMOBillPopupVue from '../../../components/ZLGL/ICMOBillPopup.vue'
     import ProcExchBillPopupVue from '../../../components/ZLGL/ProcExchBillPopup.vue'
     import ProcessPopupVue from '../../../components/ZLGL/ProcessPopup.vue'
+    import CheckProjectPopupVue from '../../../components/ZLGL/CheckProjectPopup.vue'
     import {
         getUserInfo
     } from '../../../utils/auth'
@@ -427,7 +430,8 @@
             MaterialPopupVue,
             ICMOBillPopupVue,
             ProcExchBillPopupVue,
-            ProcessPopupVue
+            ProcessPopupVue,
+            CheckProjectPopupVue
         },
         computed: {
             judgeConclusion: {
@@ -732,6 +736,11 @@
                 this.enablePopupModule = this.PopupModuleNameList[index]
                 console.log('this.$refs: ', this.$refs);
                 await this.$nextTick()
+                if (index == 7) {
+                    // 妫�楠屾柟妗堥渶瑕侀澶栦紶閫掑伐搴忓拰鐗╂枡鍚嶇О涓や釜鍙傛暟
+                    this.$refs.listPopup.setRequiredInfo(item.HMaterName, item.HProcName)
+                }
+
                 this.$refs.listPopup.showPopup()
             },
             getAnalysisMethodDisplay(val) {
@@ -745,7 +754,7 @@
                 console.log('event: ', event);
             },
             // 妫�楠岄」鐩柊澧炶
-            addCheckItem() {
+            addCheckItem(resource) {
                 let ordinal = this.getObjLength(this.checkItems) + 1
                 let checkItem = {
                     "num": ordinal,
@@ -787,7 +796,16 @@
                     "HInspectResultToSee": ""
                 }
 
+                if (resource) { // 閫氳繃涓昏〃妫�楠屾柟妗堝甫鍑虹殑妫�楠岄」鐩�
+                    Object.assign(checkItem, resource)
+                }
+
                 this.$set(this.checkItems, ordinal, checkItem)
+
+                this.$nextTick(() => {
+                    // 妫�鏌ユ槸鍚﹀彲浠ユ柊澧炴楠屽�奸」
+                    this.setInspectValModule(this.checkItems[ordinal])
+                })
 
 
             },
@@ -954,16 +972,16 @@
                     this.enablePopupModule = this.PopupModuleNameList[0]
                 }
             },
-            // 妫�楠屾柟妗堣繑鍥�
+            // 妫�楠屾柟妗�(涓昏〃)杩斿洖
             async HQCSchemeComplete(e) {
                 console.log('HQCSchemeRet: ', e);
                 for (var key in e["retVal"]) {
                     let data = e["retVal"][key]
                     Object.assign(this.hform, {
-                        // "HMaterNumber": data["鐗╂枡浠g爜"],
-                        // "HMaterName": data["鐗╂枡鍚嶇О"],
-                        // "HMaterID": data["HItemID"],
+                        HQCSchemeID: data.hmainid,
+                        HQCSchemeName: data.妫�楠屾柟妗堝悕绉�
                     })
+                    await this.get_CheckItem();
                     await this.$nextTick()
                     this.$refs.listPopup.exit()
                     // 纭繚鍦ㄥ脊绐楃粨鏉熷悗锛屽啀灏嗛〉闈笂鎸傚湪鐨勭粍浠剁疆绌�
@@ -1014,6 +1032,79 @@
                 this.checkItems[data.num] = Object.assign(this.checkItems[data.num], data)
                 this.$set(this.InspectValues, `${data.num}`, list)
             },
+            // 甯﹀嚭妫�楠岄」鐩�
+            async get_CheckItem() {
+                try {
+                    let res = await CommonUtils.doRequest2Async({
+                        url: '/Web/GetCheckItemByCheckProjectID',
+                        data: {
+                            CheckProjectID: this.hform.HQCSchemeID || 0,
+                            HBatchQty: this.hform.HProcExchQty
+                        }
+                    })
+
+                    let {
+                        data,
+                        count,
+                        Message
+                    } = res.data
+
+                    if (count == 1) {
+                        for (var i = 0; i < data.length; i++) {
+                            let checkItem = {
+                                "HQCCheckItemID": data[i]["HQCCheckItemID"],
+                                "HQCCheckItemNumber": data[i]["妫�楠岄」鐩唬鐮�"],
+                                "HQCCheckItemName": data[i]["妫�楠岄」鐩�"],
+                                "HInspectInstruMentID": data[i]["HInspectInstruMentID"],
+                                "HInspectInstruMentNumber": data[i]["妫�楠屼华鍣ㄤ唬鐮�"],
+                                "HInspectInstruMentName": data[i]["妫�楠屼华鍣�"],
+                                "HQCStd": data[i]["HQCStd"],
+                                "HUnit": data[i]["鍗曚綅鍚嶇О"],
+                                "HQCNote": "",
+                                "HAnalysisMethod": data[i]["鍒嗘瀽鏂规硶"],
+                                "HResult": data[i]["榛樿缁撹"],
+                                "HMax": "",
+                                "HMin": "",
+                                "HAvg": "",
+                                "HRemark": "",
+                                "HKeyInspect": data[i]["閲嶇偣妫�鏌�"] == 1 ? true : false,
+                                "HStatus": 0,
+                                "HSampleSchemeID": data[i]["HSampleSchemeID"],
+                                "HUnitID": data[i]["HUnitID"],
+                                "HInspectVal": '',
+                                "HTargetVal": '',
+                                "HUpLimit": data[i].涓婇檺鍊�,
+                                "HDownLimit": data[i].涓嬮檺鍊�,
+                                "HUpOffSet": '',
+                                "HDownOffSet": '',
+                                "HSampleDamageQty": "0",
+                                "HSampleSchemeName": data[i].鎶芥牱鏂规鍚嶇О,
+                                "HSampleQty": data[i].鏍锋湰閲�,
+                                "HAcceptQty": data[i].鍏佽鏁�,
+                                "HInspectionLevel": data[i].妫�楠屾按骞�,
+                                "HRejectQty": data[i].鎷掔粷鏁�,
+                                "HStrictness": data[i].涓ユ牸搴�,
+                                "HSampleUnRightQty": "",
+                                "HAQL": data[i].AQL,
+                                "HSamplingType": data[i].鎶芥牱绫诲瀷
+                            }
+
+                            this.addCheckItem(checkItem)
+                        }
+
+                    } else {
+                        CommonUtils.showTips({
+                            title: '娓╅Θ鎻愮ず',
+                            message: `鑾峰彇妫�楠岄」鐩俊鎭け璐�: ${Message} `
+                        })
+                    }
+                } catch (err) {
+                    CommonUtils.showTips({
+                        title: '娓╅Θ鎻愮ず',
+                        message: `鑾峰彇妫�楠岄」鐩俊鎭け璐�: ${err} `
+                    })
+                }
+            },
             async getMaxBillNo() {
                 try {
                     let res = await CommonUtils.doRequest2Sync({

--
Gitblit v1.9.1