wtt
2025-12-29 4277f68bd34259d422cccb8edeb11cff65d420fe
全检检验单新增模块
9个文件已修改
2个文件已添加
2212 ■■■■■ 已修改文件
.hbuilderx/launch.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/BillListPopup/BillListPopup.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/mujulingliaochukudan/MouldProdOutBill.vue 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/ZLGL/QualityReportStep/QualityReportStepBill.vue 1536 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/ZLGL/QualityReportStep/QualityReportStepBillList.vue 557 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/ZLGL/lailiaojianyan/POStockInCheckBill.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/tab2.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
uni_modules/zxz-uni-data-select/components/zxz-uni-data-select/zxz-uni-data-select.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/common.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
.hbuilderx/launch.json
@@ -21,11 +21,11 @@
            "type" : "uni-app:app-ios"
        },
        {
            "customPlaygroundType" : "local",
            "customPlaygroundType" : "device",
            "localRepoPath" : "D:/WorkBench/ZY_APP_Dev/STUWMS/unpackage/debug",
            "openVueDevtools" : true,
            "packageName" : "com.shebeiguanli.www",
            "playground" : "custom",
            "playground" : "standard",
            "type" : "uni-app:app-android"
        }
    ]
components/BillListPopup/BillListPopup.vue
@@ -26,7 +26,7 @@
                        <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['HSourceInterID'], bill['单据号'], index, bill['HSourceEntryID'])">
                            @tap="clickCard(bill['HSourceInterID'], bill['单据号'], index, bill['HSourceEntryID'],bill)">
                            <view class="item" v-for="(field, index) in HFieldList" :key="index">
                                <view class="left">{{ field.ColmCols}}: </view>
                                <view class="right" v-if="field.ColmType == 'DateTime'">{{
@@ -150,7 +150,7 @@
            showPopup() {
                this.$refs.popup.open();
            },
            clickCard(interid, billno, index, entryid) {
            clickCard(interid, billno, index, entryid,bill=[]) {
                if (this.MultiSourceBill == false) { // 非多源单模式
                    // 总线方式传递数据 (可跨组件传递)
                    uni.$emit('BillSelectComplete', {
@@ -165,7 +165,8 @@
                        HInterID: interid,
                        HBillNo: billno,
                        enableMultiSourceBill: this.MultiSourceBill,
                        HEntryID: entryid || 0
                        HEntryID: entryid || 0,
                        billInfo:bill
                    })
                } else {
                    this.$set(this.HBillList[this.curPage - 1][index], 'isActive', !this.HBillList[this.curPage - 1][
manifest.json
@@ -2,8 +2,8 @@
    "name" : "智云LMES",
    "appid" : "__UNI__B002F49",
    "description" : "",
    "versionName" : "2.0.39",
    "versionCode" : 239,
    "versionName" : "2.0.40",
    "versionCode" : 240,
    "transformPx" : false,
    /* 5+App特有相关 */
    "app-plus" : {
pages.json
@@ -1336,6 +1336,21 @@
                "navigationBarTitleText" : "模具档案查询",
                "enablePullDownRefresh": true
            }
        },
        {
            "path" : "pages/ZLGL/QualityReportStep/QualityReportStepBill",
            "style" :
            {
                "navigationBarTitleText" : "全检检验单(不良汇报)",
                "pageOrientation": "auto" // 支持横屏
            }
        },
        {
            "path" : "pages/ZLGL/QualityReportStep/QualityReportStepBillList",
            "style" :
            {
                "navigationBarTitleText" : "全检检验单(不良汇报)查询"
            }
        }
        
    ],
pages/MJGL/mujulingliaochukudan/MouldProdOutBill.vue
@@ -1015,50 +1015,7 @@
                    this.hform.HBarCode = ""
                })
            },
            delMater(item) {
                if (event && event.target.classList && event.target.classList.contains('link-text')) {
                            return; // 如果是链接点击,不执行删除
                        }
                uni.showModal({
                    title: '提示',
                    content: '确认要删除 "' + item.物料名称 + '" 所有扫码记录?删除后将不可恢复!',
                    success: (res) => {
                        if (res.confirm) {
                            uni.request({
                                url: this.serverUrl +
                                    '/WEBSController/set_DelPonderationBillMain_Temp_InterIDAndSource_Json',
                                data: {
                                    HInterID: this.hform.HInterID,
                                    HMaterID: item.HMaterID,
                                    HAuxPropID: item.HAuxPropID,
                                    HMTONo: item.HMTONo,
                                    HSourceInterID: item.HSourceInterID,
                                    HSourceEntryID: item.HSourceEntryID,
                                    HBillType: this.hform.HBillType
                                },
                                success: (res) => {
                                    if (res.data.count == 1) {
                                        this.DisBillEntryList()
                                    } else {
                                        uni.showToast({
                                            title: res.data.Message,
                                            icon: 'none'
                                        })
                                    }
                                },
                                fail: (res) => {
                                    console.log(res);
                                    uni.showToast({
                                        title: '接口请求失败',
                                        icon: 'none'
                                    })
                                }
                            });
                        }
                    }
                });
            },
            delMater(item) {   
                uni.showModal({
                    title: '提示',
pages/ZLGL/QualityReportStep/QualityReportStepBill.vue
New file
@@ -0,0 +1,1536 @@
<template>
    <view>
        <!-- 主表区域 -->
        <view class="bill-main-area">
            <!-- 主表页签 -->
            <view class="bill-main-tabs">
                <view :class="mainTabSelected == 1 ? 'selected' : ''" @tap="mainTabSelected = 1">基本信息</view>
                <view :class="mainTabSelected == 2 ? 'selected' : ''" @tap="mainTabSelected = 2">扫描信息</view>
                <view :class="mainTabSelected == 3 ? 'selected' : ''" @tap="mainTabSelected = 3">制单信息</view>
            </view>
            <!-- 主表内容 -->
            <view class="bill-main-contents">
                <!-- 基本信息 -->
                <view class="bill-main-content" v-if="mainTabSelected == 1">
                    <view class="form-item">
                        <view class="left">单据号</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HBillNo" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">日期</view>
                        <view class="right">
                            <uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HDate">
                                <view>{{ hform.HDate }}</view>
                            </uni-datetime-picker>
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">源单类型</view>
                        <view class="right-select" style="position: relative" :class="!hasSourceBill?'':'disabled'">
                            <!-- <picker mode="selector" :range="HSourceBillTypeNameList" :disabled="hasSourceBill"
                                @change="HSourceBillTypeNameChange">
                                <input type="text" placeholder="请选择源单类型" v-model="HSourceBillType" />
                                <view class="picker-overlay"></view>
                            </picker> -->
                            <zxz-uni-data-select
                                v-model="hform.HSourceBillType"
                                dataKey="typeName"
                                dataValue="typeID"
                                :filterable="true"
                                :localdata="HSourceBillTypeList"
                                :clear="false"
                                :disabled="hasSourceBill"
                                @change="HSourceBillTypeNameChange"
                            ></zxz-uni-data-select>
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">源单单号</view>
                        <view class="right" :class="!hasSourceBill?'':'disabled'">
                            <input type="text" :disabled="hasSourceBill" placeholder="请输入或扫描源单号"
                                v-model="hform.HSourceBillNo" @confirm="getSourceBillInfo(hform.HSourceBillNo)" />
                        </view>
                        <view class="icon-wrapper-big">
                            <uni-icons class="right-icon" type="scan"
                                :class="!hasSourceBill?'enable-icon-button':'disable-icon-button'"
                                :disabled="hasSourceBill" size="20" @click="toScanCode"></uni-icons>
                        </view>
                        <view class="icon-wrapper-big">
                            <uni-icons class="right-icon" type="search"
                                :class="!hasSourceBill?'enable-icon-button':'disable-icon-button'"
                                :disabled="hasSourceBill" size="20" @click="toBillSelector"></uni-icons>
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">产品代码</view>
                        <view class="right disabled">
                            <input type="text" disabled :value="hform.HMaterNumber" />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">产品名称</view>
                        <view class="right disabled">
                            <input type="text" disabled :value="hform.HMaterName" />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">源单数量</view>
                        <view class="right disabled">
                            <input type="number" v-model="hform.HSourceBillQty" />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">检验数量</view>
                        <view class="right">
                            <input type="number" v-model="hform.HCheckQty" :disabled="hasCheckQty" />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">生产班组</view>
                        <view class="right-select">
                            <zxz-uni-data-select
                                v-model="hform.HGroupID"
                                dataKey="班组名称"
                                dataValue="HItemID"
                                :filterable="true"
                                :localdata="HGroupList"
                                :clear="false"
                            ></zxz-uni-data-select>
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">检验员</view>
                        <view class="right-select">
                            <zxz-uni-data-select
                                v-model="hform.HEmpID"
                                dataKey="职员名称"
                                dataValue="HItemID"
                                :filterable="true"
                                :localdata="HCheckEmpList"
                                :clear="false"
                            ></zxz-uni-data-select>
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">工序</view>
                        <view class="right disabled">
                            <input type="text" disabled :value="hform.HProcName" />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">生产资源</view>
                        <view class="right-select">
                            <zxz-uni-data-select
                                v-model="hform.HSourceID"
                                dataKey="生产资源名称"
                                dataValue="HItemID"
                                :filterable="true"
                                :localdata="HSourceList"
                                :clear="false"
                            ></zxz-uni-data-select>
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">备注</view>
                        <view class="right">
                            <input type="text" v-model="hform.HRemark" value="" />
                        </view>
                    </view>
                </view>
                <!-- 其他信息 -->
                <view class="bill-main-content" v-if="mainTabSelected == 2">
                    <view class="list" v-for="(item,index) in HisReportList" :key="index">
                        <uni-card :title="item.HBadReasonName" style="margin: 10px;" @tap="delReason(item, $event)">
                            <view class="card-detail">
                               <view
                                   class="detail"
                                   v-for="(value, key,keyIndex) in item"
                                   :key="key"
                                   v-if="shouldShowField(key, value)"
                               >
                                   <text>{{ formatFieldName(key) }}:</text>{{ value }}
                               </view>
                            </view>
                        </uni-card>
                    </view>
                </view>
                <!-- 制单信息 -->
                <view class="bill-main-content" v-if="mainTabSelected == 3">
                    <view class="form-item">
                        <view class="left">制单人</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HMaker" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">制单日期</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HMakeDate" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">审核人</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HChecker" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">审核日期</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HCheckDate" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">关闭人</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HCloseMan" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">关闭日期</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HCloseDate" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">修改人</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HUpDater" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">修改日期</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HUpDateDate" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">作废人</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HDeleteMan" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">作废日期</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HDeleteDate" disabled />
                        </view>
                    </view>
                </view>
            </view>
        </view>
        <!-- 子表区域 -->
        <view class="bill-sub-area">
            <!-- 子表页签 -->
            <view class="bill-sub-tabs">
                <view v-for="subTab in subTabs" :key="subTab.typeID" :class="subTab.typeID == subTabSelected ? 'selected' : ''"
                    @tap="subTabSelected = subTab.typeID">{{ subTab.typeName }}</view>
            </view>
            <!-- 子表内容 -->
            <view class="reason-container-flex">
                <!-- 检测值 呈现 -->
                <view  v-for="item in HBadReasonList"
                    v-if="item.不良类型id==subTabSelected"
                    :key="item.HItemID"
                    class="reason-item-flex"
                    :class="{ 'double-clicked': item.isDoubleClicked }"
                    @click="reasonClick(item)"
                >
                    <view >
                        <view>{{ item.不良原因代码 }}</view>
                        <view>{{ item.不良原因名称 }}</view>
                        <view>汇报总数:{{ item.num }}</view>
                    </view>
                </view>
            </view>
        </view>
        <view style="height: 120rpx"></view>
        <view class="bottom-btn">
            <button class="btn-a" size="mini" @tap="submit">提交</button>
            <view style="flex: 1"></view>
            <button class="btn-a" size="mini" @tap="addNew">新增</button>
            <button class="btn-c" size="mini" @tap="goBack">退出</button>
        </view>
        <BillListPopupVue ref="billList" :HBillType="hform.HBillType" :HSourceBillType="hform.HSourceBillType"
            :HStockOrgID="hform.HStockOrgID" @BillSelectComplete="HandleBillSelectComplete"></BillListPopupVue>
    </view>
</template>
<script>
    import dayjs from "dayjs";
    import {
        CommonUtils
    } from "../../../utils/common";
    import BillListPopupVue from "../../../components/BillListPopup/BillListPopup.vue";
    import {
        getUserInfo
    } from "../../../utils/auth";
    import {
        MpaasScan
    } from "../../../utils/mpaasScan";
    export default {
        components: {
            BillListPopupVue,
        },
        computed: {
        },
        data() {
            return {
                serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
                //上一次点击时间
                lastClickTime: 0,
                operationType: 1,
                mainTabSelected: 1,
                subTabSelected: 0,
                // 源单状态控制
                hasSourceBill: false,
                hasCheckQty:false,
                // 子表 页签信息
                subTabs: {
                    0: {
                        typeID: "0",
                        typeName: "其它类型",
                    },
                },
                HBadReasonList:[],
                //源单类型
                HSourceBillTypeList:[{typeID:"3772",typeName:"工序流转卡"},{typeID:"0",typeName:"历史缓存"}],
                //生产资源
                HSourceList:[],
                //检验员
                HCheckEmpList:[],
                //班组
                HGroupList:[],
                //历史扫码记录
                HisReportList:[],
                // 主表属性
                hform: {
                    HBillType: '3717',
                    HBillNo: "",
                    HInterID: "0",
                    HDate: dayjs(new Date()).format("YYYY-MM-DD"),
                    HSourceID: getUserInfo().HSourceID,
                    HEmpID:getUserInfo().HEmpID,
                    HGroupID:getUserInfo().HGroupID,
                    HDeptID:0,
                    HMaterNumber: "",
                    HMaterID: "0",
                    HMaterName: "",
                    HProcID: "0",
                    HRemark: "",
                    HMaker: getUserInfo()["Czymc"] || "",
                    HChecker: "",
                    HCloseMan: "",
                    HMakeDate: dayjs(new Date()).format("YYYY-MM-DDTHH:mm:ss"),
                    HCheckDate: "",
                    HCloseDate: "",
                    HUpDater: "",
                    HDeleteMan: "",
                    HUpDateDate: "",
                    HDeleteDate: "",
                    HCheckQty: 0,
                    //源单信息
                    HSourceBillQty: 0,
                    HSourceBillType: "3772",
                    //流转卡信息
                    HICMOBillNo: "",
                    HICMOInterID: "0",
                    HICMOEntryID: "1",
                    HICMOQty: "0",
                    HProcExchBillNo: "",
                    HProcExchInterID: "0",
                    HProcExchEntryID: "0",
                    HProcExchQty: "0",
                    HMainSourceBillType: "",
                    HMainSourceInterID: "0",
                    HMainSourceEntryID: "1",
                    HMainSourceBillNo: "",
                    HStockOrgID: uni.getStorageSync('OrganizationID'),
                },
            };
        },
        methods: {
            // 判断哪些字段需要显示
            shouldShowField(key, value) {
                // 排除不需要显示的字段
                const excludeKeys = ['单据号', '日期']; // 这些字段已经在其他地方显示了
                // 判断key是否全英文(不包含中文)
                const isAllEnglish = /^[a-zA-Z]+$/.test(key);
                // 判断key是否包含"ID"(不区分大小写)
                const containsID = key.toUpperCase().includes('ID');
                return !excludeKeys.includes(key) &&
                       //!isAllEnglish && // 排除全英文的key
                       !containsID && // 排除包含ID的key
                       value !== null &&
                       value !== undefined &&
                       value !== '';
            },
            // 格式化字段名显示
            formatFieldName(key) {
                // 你可以根据需求自定义显示名称
                const nameMap = {
                    'HBadReasonNumber': '不良原因代码',
                    'HBadReasonHName': '不良原因名称',
                    'HCheckMan': '检验员',
                    'HGroupName': '班组',
                    'HSourceName': '生产资源',
                    // ... 其他字段映射
                };
                return nameMap[key] || key;
            },
            //不良原因单击
            reasonClick(item) {
                const now = Date.now();
                if (now - this.lastClickTime < 300) {
                  // 双击逻辑
                  this.handleDoubleClick(item);
                  this.lastClickTime = 0;
                } else {
                  // 单击逻辑
                  this.handleSingleClick(item);
                  this.lastClickTime = now;
                }
            },
            handleSingleClick(item) {
                console.log('单击:', item.不良原因名称);
            },
            handleDoubleClick(item) {
                // 设置双击状态
                this.$set(item, 'isDoubleClicked', true);
                // 300ms后移除动画类(与动画时长匹配)
                setTimeout(() => {
                  this.$set(item, 'isDoubleClicked', false);
                }, 300);
                // 实际业务逻辑
                console.log('双击:', item.不良原因名称);
                this.submitBarCode(item);
                uni.vibrateShort(); // 可选:震动反馈
            },
            // 源单类型选择
            HSourceBillTypeNameChange(e) {
                const pages = getCurrentPages()
                // 获取页面栈中的最后一个元素,也就是当前显示的页面
                const currentPage = pages[pages.length - 1]
                // 选择源单类型后 缓存当前页面选择
                uni.setStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`, {
                    HSourceBillType: this.hform.HSourceBillType
                })
            },
            // 读取缓存
            loadCache() {
                const pages = getCurrentPages()
                // 获取页面栈中的最后一个元素,也就是当前显示的页面
                const currentPage = pages[pages.length - 1]
                let HBillTypeCache = uni.getStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`)
                if (HBillTypeCache) {
                    this.hform.HSourceBillType = HBillTypeCache.HSourceBillType
                }
            },
            // 根据源单类型选择单据
            toBillSelector() {
                this.$refs['billList'].showPopup()
            },
            toScanCode() {
                MpaasScan.scanCode((res) => {
                    if (res) {
                        this.getSourceBillInfo(HBarCode);
                    }
                });
            },
            async getGy_BadReasonList() {
                let sWhere = ` and HUSEORGID = '${uni.getStorageSync('OrganizationID')}' and ISNULL(审核人,'')  != '' order by 不良原因代码`
                let res = await CommonUtils.doRequest2Async({
                    url: "/Gy_BadReason/list",
                    data: {
                        sWhere:sWhere,
                        user:getUserInfo()["Czymc"]
                    }
                })
                console.log(res)
                let {
                    data,
                    Message,
                    count
                } = res.data
                if (count == 1) {
                    data.forEach(item=>{
                        const typeID = item["不良类型id"]
                        const typeName = item["不良类型"]
                        if (!this.subTabs[typeID]) {
                            this.subTabs[typeID] = {
                              typeID: typeID,
                              typeName: typeName
                            }
                        }
                    })
                    this.HBadReasonList = data;
                } else {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: Message
                    })
                }
            },
            async getSourceBillInfo(HBarCode) {
                console.log('HBarCode: ', HBarCode);
                let res = await CommonUtils.doRequest2Async({
                    url: "/WEBSController/get_CheckBillBarCode_Json_CheckItem",
                    data: {
                        HBillType: this.hform.HBillType,
                        HSourceBillType: this.hform.HSourceBillType,
                        HBarCode: HBarCode,
                        HInterID: 0,
                        HEntryID: 0,
                        Mode: 1 //扫码模式
                    }
                })
                console.log(res)
                let {
                    data,
                    Message,
                    count
                } = res.data
                if (count == 1) {
                    this.hform.HMaterID = data[0]['HMaterID']
                    this.hform.HMaterName = data[0]['产品名称']
                    this.hform.HMaterNumber = data[0]['产品代码']
                    //源单信息
                    this.hform.HMainSourceBillNo = data[0]['HBillNo']
                    this.hform.HSourceBillNo = data[0]['HBillNo']
                    this.hform.HMainSourceInterID = data[0].HInterID
                    this.hform.HMainSourceEntryID = data[0].HEntryID
                    this.hform.HSourceBillQty = data[0].流转卡数量
                    this.hform.HICMOBillNo= data[0].任务单号
                    this.hform.HICMOInterID= data[0].HICMOInterID
                    this.hform.HICMOEntryID= data[0].HICMOEntryID
                    this.hform.HICMOQty= data[0].生产数量
                    this.hform.HProcExchBillNo= data[0].单据号
                    this.hform.HProcExchInterID= data[0].HInterID
                    this.hform.HProcExchEntryID= data[0].HEntryID
                    this.hform.HProcExchQty= data[0].流转卡数量
                    this.hasSourceBill = true
                    this.hform.HSourceName= data[0].生产资源
                    this.hform.HSourceID= data[0].HSourceID
                    this.hform.HProcID= data[0].HProcID
                    this.hform.HProcName= data[0].当前工序
                    this.hform.HDeptID= data[0].HWorkShopID
                } else {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: Message
                    })
                }
            },
            async HandleBillSelectComplete(e) {
                if(this.hform.HSourceBillType=="0"){
                    this.hform.HSourceBillType = e.billInfo["HSourceBillType"];
                    this.hform.HBillNo = e.billInfo["缓存单据号"];
                    this.hform.HInterID = e.billInfo["HInterID"];
                    this.hform.HCheckQty = e.billInfo["检验数量"];
                    await this.getHisReportList();
                }
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/WEBSController/get_CheckBillBarCode_Json_CheckItem",
                        data: {
                            HBillType: this.hform.HBillType,
                            HSourceBillType: this.hform.HSourceBillType,
                            HBarCode: "",
                            HInterID: e?.HInterID,
                            HEntryID: e?.HEntryID,
                            Mode: 2 //选单模式
                        }
                    })
                    let {
                        data,
                        Message,
                        count
                    } = res.data
                    if (count == 1) {
                        console.log('获取源单:', data)
                        this.hform.HMaterID = data[0]['HMaterID']
                        this.hform.HMaterName = data[0]['产品名称']
                        this.hform.HMaterNumber = data[0]['产品代码']
                        //源单信息
                        this.hform.HMainSourceBillNo = data[0]['HBillNo']
                        this.hform.HSourceBillNo = data[0]['HBillNo']
                        this.hform.HMainSourceInterID = data[0].HInterID
                        this.hform.HMainSourceEntryID = data[0].HEntryID
                        this.hform.HSourceBillQty = data[0].流转卡数量
                        this.hform.HICMOBillNo= data[0].任务单号
                        this.hform.HICMOInterID= data[0].HICMOInterID
                        this.hform.HICMOEntryID= data[0].HICMOEntryID
                        this.hform.HICMOQty= data[0].生产数量
                        this.hform.HProcExchBillNo= data[0].单据号
                        this.hform.HProcExchInterID= data[0].HInterID
                        this.hform.HProcExchEntryID= data[0].HEntryID
                        this.hform.HProcExchQty= data[0].流转卡数量
                        this.hasSourceBill = true
                        this.hform.HSourceName= data[0].生产资源
                        this.hform.HSourceID= data[0].HSourceID
                        this.hform.HProcID= data[0].HProcID
                        this.hform.HProcName= data[0].当前工序
                        this.hform.HDeptID= data[0].HWorkShopID
                        this.$refs['billList'].exit()
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: "源单下推错误: " + err
                    })
                }
            },
            // 历史扫码记录获取初始化
            async getHisReportList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Sc_QualityReportBill/get_BarCodeDetail",
                        data: {
                            HInterID: this.hform.HInterID,
                        },
                    });
                    let {
                        data,
                        Message,
                        count
                    } = res.data;
                    if (count == 1) {
                        console.log("data: ", data);
                        this.HisReportList = data;
                    } else {
                        this.HisReportList = [];
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `获取历史扫码记录失败: ${Message}`,
                        });
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `获取历史扫码记录失败: ${err}`,
                    });
                }
            },
            //删除历史记录
            delReason(item) {
                uni.showModal({
                    title: '提示',
                    content: '确认要删除 "' + item.HBadReasonHName + '" 的扫码记录?删除后将不可恢复!',
                    success: (res) => {
                        if (res.confirm) {
                            uni.request({
                                url: this.serverUrl +
                                    '/Sc_QualityReportBill/del_BarCodeDetail',
                                data: {
                                    HItemID: item.HItemID,
                                },
                                success: (res) => {
                                    if (res.data.count == 1) {
                                        this.getHisReportList()
                                        uni.showToast({
                                            title: "删除成功",
                                            icon: 'none'
                                        })
                                    } else {
                                        uni.showToast({
                                            title: res.data.Message,
                                            icon: 'none'
                                        })
                                    }
                                },
                                fail: (res) => {
                                    console.log(res);
                                    uni.showToast({
                                        title: '接口请求失败',
                                        icon: 'none'
                                    })
                                }
                            });
                        }
                    }
                });
            },
            // 检验员初始化
            async InitHEmp() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Gy_Employee/list",
                        data: {
                            sWhere: ` and 组织名称 = '${uni.getStorageSync("Organization")}' and 禁用标记 = ''and 审核人 !='' order by 部门代码`,
                            user: getUserInfo()["Czymc"],
                            Organization: uni.getStorageSync("Organization"),
                        },
                    });
                    let {
                        data,
                        Message,
                        count
                    } = res.data;
                    if (count == 1) {
                        console.log("data: ", data);
                        this.HCheckEmpList = data;
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `初始化检验员失败: ${Message}`,
                        });
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `初始化检验员失败: ${err}`,
                    });
                }
            },
            // 生产资源初始化
            async InitHSource() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Gy_Source/list",
                        data: {
                            sWhere: `and 禁用标记 != 'Y' and ISNULL(审核人,'')  != '' and 组织 = '${uni.getStorageSync("Organization")}'`,
                            user: getUserInfo()["Czymc"],
                        },
                    });
                    let {
                        data,
                        Message,
                        count
                    } = res.data;
                    if (count == 1) {
                        this.HSourceList = data;
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `初始化生产资源失败: ${Message}`,
                        });
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `初始化生产资源失败: ${err}`,
                    });
                }
            },
            // 班组初始化
            async InitHGroup() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Gy_Group/list",
                        data: {
                            sWhere: `and 禁用标记 != 'Y' and ISNULL(审核人,'')  != '' and 组织 = '${uni.getStorageSync("Organization")}'`,
                            user: getUserInfo()["Czymc"],
                        },
                    });
                    let {
                        data,
                        Message,
                        count
                    } = res.data;
                    if (count == 1) {
                        this.HGroupList = data;
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `初始化班组失败: ${Message}`,
                        });
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `初始化班组失败: ${err}`,
                    });
                }
            },
            async getMaxBillNo() {
                try {
                    let res = await CommonUtils.doRequest2Sync({
                        url: "/Web/GetMAXNum",
                        data: {
                            HBillType: "3717",
                        },
                    });
                    if (!res) {
                        return;
                    }
                    let {
                        data,
                        Message,
                        count
                    } = res.data;
                    if (count == 1) {
                        this.hform.HInterID = data[0].HInterID;
                        this.hform.HBillNo = data[0].HBillNo;
                    } else {
                        throw Message;
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: "获取单据号异常: " + err,
                    });
                }
            },
            //提交不良原因扫码记录缓存
            async submitBarCode(item){
                if(!this.checkSubmitValidate()){
                    return
                }
                try {
                    let oMainObject = {
                        HInterID:this.hform.HInterID//递入type得到的单据ID
                        ,HBillNo:this.hform.HBillNo
                        ,HBillType:this.hform.HBillType
                        ,HDate:new Date()
                        ,HICMOBillNo:this.hform.HICMOBillNo
                        ,HICMOInterID:this.hform.HICMOInterID
                        ,HICMOEntryID:this.hform.HICMOEntryID
                        ,HProcExchBillNo:this.hform.HProcExchBillNo
                        ,HProcExchInterID:this.hform.HProcExchInterID
                        ,HProcExchEntryID:this.hform.HProcExchEntryID
                        ,HProcID:this.hform.HProcID
                        ,HMaterID:this.hform.HMaterID
                        ,HSourceID:this.hform.HSourceID
                        ,HGroupID:this.hform.HGroupID
                        ,HDeptID:this.hform.HDeptID
                        ,HCheckManID:this.hform.HEmpID
                        ,HBadReasonID:item.HItemID
                        ,HBarCode:item.不良原因代码
                        ,HMaker:this.hform.HMaker
                        ,HMakeDate:this.hform.HMakeDate
                        ,HReportType:1
                        ,HSourceBillType:this.hform.HSourceBillType
                        ,HBadReasonHQty:1
                        ,HQty:this.hform.HCheckQty
                    }
                    var sMainStr = JSON.stringify(oMainObject);
                    var oMain = sMainStr + ';' + this.operationType;
                    let res = await CommonUtils.doRequest2Sync({
                        url: "/Sc_QualityReportBill/set_SaveBarCode",
                        data: {
                            oMain: oMain,
                        },
                        method: "POST",
                    });
                    if (!res) {
                        return;
                    }
                    let {
                        count,
                        Message,
                        data
                    } = res.data;
                    if (count == 1) {
                        CommonUtils.showTips({
                            title: "保存成功",
                            message: `保存成功`,
                        });
                        if(!item.num){
                            this.$set(item, 'num', 1);
                        }else{
                            this.$set(item, 'num', item.num++);
                        }
                        //this.$set(item, 'num', newValue);
                        this.getHisReportList();
                        this.hasCheckQty=true;
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `不良原因保存错误: ${Message}`,
                        });
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `不良原因保存错误: ${err}`,
                    });
                }
            },
            checkSubmitValidate() {
                // if (this.hform.HICMOQty == "" || this.hform.HICMOQty <= 0) {
                //     CommonUtils.showTips({
                //         message: "任务单数量不能为空且不能小于等于0!",
                //     });
                //     return false;
                // }
                if (this.hform.HCheckQty==0||this.hform.HCheckQty=="") {
                    CommonUtils.showTips({
                        message: "请输入检验数量!",
                    });
                    return false;
                }
                if (this.hform.HEmpID == 0) {
                    CommonUtils.showTips({
                        message: "检验员未选择!",
                    });
                    return false;
                }
                if (!this.hasSourceBill) {
                    CommonUtils.showTips({
                        message: "源单未选择!",
                    });
                    return false;
                }
                return true;
            },
            async submit() {
                // if (!this.checkSubmitValidate()) {
                //     return;
                // }
                try {
                    console.log('this.$refs: ', this.$refs);
                    let res = await CommonUtils.doRequest2Sync({
                        url: "/Sc_QualityReportBill/set_SaveBill",
                        data: {
                            HInterID: this.hform.HInterID,
                            HBillNo: this.hform.HBillNo,
                            HChecker: getUserInfo()["Czymc"],
                            HBillSubType: this.hform.HBillType
                        },
                        method: "Get",
                    });
                    if (!res) {
                        return;
                    }
                    let {
                        count,
                        Message,
                        data
                    } = res.data;
                    if (count == 1) {
                        uni.showModal({
                            title: "提示",
                            content: res.data.Message + "。是否继续新增?",
                            success: (res) => {
                                if (res.confirm) {
                                    console.log("用户点击确定");
                                    uni.redirectTo({
                                        url: "/pages/ZLGL/QualityReportStep/QualityReportStepBill?operationType=1",
                                    });
                                } else if (res.cancel) {
                                    console.log("用户点击取消");
                                    // setTimeout(() => {
                                    //     uni.navigateBack();
                                    // }, 50)
                                }
                            },
                        });
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `全检检验单单保存错误: ${Message}`,
                        });
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `全检检验单单保存错误: ${err}`,
                    });
                }
            },
            addNew() {
                uni.redirectTo({
                    url: "/pages/ZLGL/QualityReportStep/QualityReportStepBill",
                });
            },
            goBack() {
                uni.navigateBack();
            },
            async RoadBillMain() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/QC_ProcessCheckBill/QC_ProcessCheckBill_Edit",
                        data: {
                            sWhere: ` and hmainid=${this.hform.HInterID}`,
                            user: getUserInfo()["Czymc"],
                        },
                    });
                    let {
                        data,
                        count,
                        Message
                    } = res.data;
                    if (count == 1) {
                        console.log("RoadBillMain: : ", data);
                        Object.assign(this.hform, {
                            HInterID: data[0].hmainid,
                            HBillNo: data[0].单据号,
                            HDate: dayjs(data[0].日期).format("YYYY-MM-DD"),
                            HSourceID: data[0].HSourceID,
                            HSourceName: data[0].生产资源名称,
                            HICMOBillNo: data[0].任务单号,
                            HICMOQty: data[0].任务单数量,
                            HICMOInterID: data[0].HICMOInterID,
                            HICMOEntryID: data[0].HICMOEntryID || 1,
                            HMaterID: data[0].HMaterID,
                            HMaterName: data[0].物料名称,
                            HMaterNumber: data[0].物料代码,
                            HProcID: data[0].HProcID,
                            HProcName: data[0].HProcName,
                            HProcExchQty: data[0].HProcExchQty || 0,
                            HProcExchBillNo: data[0].HProcExchBillNo,
                            HProcExchInterID: data[0].HProcExchInterID,
                            HProcExchEntryID: data[0].HProcExchEntryID || 0,
                            HFirstCheckEmp: data[0].HFirstCheckEmp,
                            HFirstCheckEmpName: data[0].质检员名称,
                            HQCSchemeID: data[0].检验方案ID,
                            HQCSchemeName: data[0].检验方案名称,
                            HRemark: data[0].表头备注,
                            HMaker: data[0].制单人,
                            HMakeDate: data[0].制单日期,
                            HChecker: data[0].审核人,
                            HCheckDate: data[0].审核日期,
                            HCloseMan: data[0].关闭人,
                            HCloseDate: data[0].关闭日期,
                            HUpDateDate: data[0].修改日期,
                            HDeleteDate: data[0].作废日期,
                            HSampleSchemeID: data[0].HSampleSchemeID,
                            HSampleSchemeName: data[0].抽样方案名称,
                            HSampleQty: data[0].样本量,
                            HSampleQty2: data[0].样本量,
                            HSampleDamageQty: data[0].样本破坏数,
                            HSamplingType: data[0].抽样类型,
                            HAcceptQty: data[0].允许数,
                            HInspectionLevel: data[0].检验水平,
                            HRejectQty: data[0].拒绝数,
                            HStrictness: data[0].严格度,
                            HSampleUnRightQty: data[0].样本不合格数 || 0,
                            HSampleUnRightQty2: data[0].样本不合格数,
                            HAQL: data[0].AQL,
                            HUnitID: data[0].HUnitID,
                            HUnit: data[0].单位,
                            HInspectValB: data[0].检测值基础资料,
                            HInspectVal: data[0].检测值,
                            HTargetValB: data[0].目标值基础资料,
                            HTargetVal: data[0].目标值,
                            HUpLimit: data[0].上限值,
                            HDownLimit: data[0].下限值,
                            HUpOffSet: data[0].上偏差,
                            HDownOffSet: data[0].下偏差,
                            HEntryID: data[0].hsubid,
                            HQCCheckItemName: data[0].检验项目名称,
                            HQCCheckItemID: data[0].HQCCheckItemID,
                            HShiftsID: data[0].HShiftsID,
                            HShiftsName: data[0].班次名称,
                            HErrTreatment: data[0].异常临时处理方案,
                            HBatchNo: data[0].批号,
                            HCheckerResult: data[0].判定结论 == "合格" ? true : false,
                            HTakeSampleCheckBillID: data[0].HTakeSampleCheckBillID,
                            HTakeSampleCheckBillNo: data[0].HTakeSampleCheckBillNo,
                            HAnalysisMethod: function() {
                                if (data[0].HAnalysisMethod == 1) {
                                    return '定性检验'
                                } else if (data[0].HAnalysisMethod == 2) {
                                    return '定量检验'
                                } else {
                                    return '其他检验'
                                }
                            }(),
                        });
                        for (let i = 0; i < data.length; i++) {
                            this.addCheckItem({
                                HQCCheckItemID: data[i].HQCCheckItemID,
                                HQCCheckItemNumber: data[i].检验项目代码,
                                HQCCheckItemName: data[i].检验项目名称,
                                HInspectInstruMentID: data[i].HInspectInstruMentID,
                                HInspectInstruMentNumber: data[i].检验仪器代码,
                                HInspectInstruMentName: data[i].检验仪器名称,
                                HQCStd: data[i].检验标准,
                                HUnit: data[i].单位名称,
                                HQCNote: data[i].检验记录,
                                HResult: data[i].结论 == "合格" ? 1 : 0,
                                HMax: data[i].最大值,
                                HMin: data[i].最小值,
                                HAvg: data[i].平均值,
                                HRemark: data[i].表体备注,
                                HAnalysisMethod: data[i].分析方法 == "定性分析" ?
                                    1 : data[i].分析方法 == "定量分析" ?
                                    2 : 3,
                                HKeyInspect: data[i].重点检查 == "否" ? false : true,
                                HSampleSchemeID: data[i].HSampleSchemeID,
                                HUnitID: data[i].HUnitID,
                                HInspectVal: data[i].检测值,
                                HTargetVal: data[i].目标值,
                                HUpLimit: data[i].上限值,
                                HDownLimit: data[i].下限值,
                                HUpOffSet: data[i].上偏差,
                                HDownOffSet: data[i].下偏差,
                                HSampleDamageQty: data[i].样本破坏数,
                                HSampleSchemeName: data[i].抽样方案名称,
                                HSampleQty: data[i].样本量,
                                HSampleDamageQty: data[i].样本破坏数,
                                HAcceptQty: data[i].允许数,
                                HInspectionLevel: 0,
                                HRejectQty: data[i].拒绝数,
                                HStrictness: 0,
                                HSampleUnRightQty: data[i].样本不合格数,
                                HAQL: data[i].AQL,
                                HSamplingType: 0,
                                HSamplingType: data[i].抽样类型,
                                HStrictness: data[i].严格度,
                                HInspectResultToSee: data[i].检验结果
                            });
                        }
                        this.hasSourceBill = true
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `加载单据失败: ${Message}`,
                        });
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `加载单据失败: ${err}`,
                    });
                }
            },
        },
        async onLoad(e) {
            this.operationType = e.operationType || 1;
            this.hform.HInterID = e.linterid || 0;
            if (this.operationType == 1) {
                await this.getMaxBillNo();
            } else if (this.operationType == 2) {
            } else if (this.operationType == 3) {
                await this.RoadBillMain();
            }
            this.getGy_BadReasonList();
            await this.InitHSource();
            await this.InitHEmp();
            await this.InitHGroup();
            await this.loadCache();
        },
    };
</script>
<style lang="scss" scoped>
    input {
        width: inherit;
        font-size: 26rpx;
    }
    .uni-input {
        padding: 0;
    }
    .bill-main-tabs,
    .bill-sub-tabs {
        box-sizing: border-box;
        width: 100%;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 20rpx;
        flex-shrink: 0;
        overflow-x: auto;
        border-bottom: 1px solid #ddd;
        padding: 20rpx 10rpx;
        white-space: nowrap;
        view {
            width: auto;
            font-size: 26rpx;
            color: #555;
            text-align: center;
            padding: 16rpx 0;
        }
        .selected {
            color: #3a78ff;
            font-weight: bold;
            border-bottom: 3px solid #3a78ff;
        }
    }
    .bill-main-content,
    .bill-sub-content {
        box-sizing: border-box;
        padding: 0 30rpx 0 30rpx;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;         /* 超出自动换行 */
        /* 可选:设置换行后的对齐方式 */
        align-content: flex-start; /* 多行对齐方式 */
        .form-item {
            width: 600rpx;
            display: flex;
            align-items: center;
            font-size: 26rpx;
            padding: 6rpx 0;
             margin-right: 20rpx;
            .left {
                width: 208rpx;
                text {
                    color: red;
                    font-weight: bold;
                }
            }
            .right {
                // width: 450rpx;
                padding: 8rpx 20rpx;
                font-size: 26rpx;
                flex: 1;
                border-radius: 22rpx;
                border: 1px solid #acacac;
                .uni-combox {
                    padding: 0;
                    height: auto;
                    .uni-input-placeholder,
                    .uni-input-input {
                        font-size: 26rpx;
                    }
                }
                .uni-combox::v-deep input {
                    height: inherit;
                    font-size: 26rpx;
                }
            }
            .right-select {
                //padding: 8rpx 20rpx;
                font-size: 26rpx;
                flex: 1;
            }
            .disabled {
                border: 1px solid #e4e4e4;
                background-color: #e4e4e4;
            }
            .none-border {
                border: none;
            }
        }
    }
    .bottom-btn {
        box-sizing: border-box;
        width: 100%;
        height: 120rpx;
        position: fixed;
        bottom: 0;
        left: 0;
        background-color: #fff;
        box-shadow: 0 2rpx 10rpx 2rpx rgba(0, 0, 0, 0.4);
        padding: 30rpx 40rpx 40rpx 40rpx;
        display: flex;
        flex-direction: row;
        gap: 10rpx;
        button {
            border-radius: 50rpx;
            width: 180rpx;
            height: 66rpx;
            line-height: 66rpx;
            font-size: 28rpx;
        }
        .btn-a {
            background-color: #3a78ff;
            color: #fff;
        }
        .btn-b {
            background-color: #41a863;
            color: #fff;
        }
        .btn-c {
            background-color: #acacac;
            color: #fff;
            // position: absolute;
            // right: 120rpx;
        }
        .btn-d {
            background-color: #ff8901;
            color: #fff;
        }
    }
    .buttons {
        box-sizing: border-box;
        width: 100%;
        display: flex;
        justify-content: center;
        padding: 10rpx 0;
        button {
            border-radius: 50rpx;
            width: 180rpx;
            height: 66rpx;
            line-height: 66rpx;
            font-size: 26rpx;
        }
        .btn-a {
            background-color: #acacac;
            color: #fff;
        }
        .btn-b {
            background-color: #41a863;
            color: #fff;
        }
        .btn-c {
            background-color: #3a78ff;
            color: #fff;
        }
    }
    .list {
        width: 50%;
        .card-detail {
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            line-height: 120%;
            gap: 10rpx 0;
            input {
                font-size: 26rpx;
            }
            .detail {
                // width: 50%;
                box-sizing: border-box;
                font-size: 26rpx;
                color: #555;
                padding-right: 20rpx;
                text {
                    color: #999;
                    font-size: 26rpx;
                }
            }
            .editable {
                width: 50%;
                display: inline-flex;
                flex-direction: row;
                align-items: center;
                text {
                    flex-shrink: 0;
                }
                .sampleDestory {
                    border: 1px solid #acacac;
                    border-radius: 10%;
                    padding: 0 12rpx;
                }
                .editable-input {
                    border: 1px solid #acacac;
                    border-radius: 5rpx;
                    padding: 0 12rpx;
                }
            }
        }
    }
    .icon-wrapper {
        background-color: #3a78ff;
        border-radius: 100%;
        width: 40rpx;
        height: 40rpx;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
        .uni-icons {
            color: #fff !important;
        }
    }
    .icon-wrapper-big {
        background-color: #3a78ff;
        border-radius: 100%;
        width: 50rpx;
        height: 50rpx;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
        margin-left: 20rpx;
        .uni-icons {
            color: #fff !important;
        }
    }
    .more {
        color: #888;
        font-size: 22rpx;
        display: flex;
        border-top: 1px solid #eee;
        padding-top: 10rpx;
        .part {
            width: 100%;
            text-align: center;
        }
    }
    .pass-background {
        background-color: #cee3f2;
        border: none;
    }
    .unpass-background {
        background-color: #f0d6e3;
        border: none;
    }
    .enable-icon-button {
        background-color: #3a78ff;
        padding: 6rpx;
        color: #fff;
        border-radius: 100%;
    }
    .disable-icon-button {
        background-color: lightgray;
        padding: 6rpx;
        color: #fff;
        border-radius: 100%;
        pointer-events: none;
    }
    /* 基础样式 */
    .reason-container-flex {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-start;
      align-items: flex-start;
      gap: 10px; /* 方块间距 */
      padding: 10px;
      box-sizing: border-box;
    }
    .reason-item-flex {
      /* 方块基础样式 */
      background-color: #f5f5f5;
      border-radius: 8px;
      padding: 12px 16px;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
      transition: all 0.3s ease;
      /* 文字样式 */
      font-size: 14px;
      color: #333;
      text-align: center;
      width: 300rpx;
      /* 确保内容不换行时居中 */
      display: flex;
      justify-content: center;
      align-items: center;
    }
    /* 双击动画效果 */
    @keyframes doubleClickPulse {
      0% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
      }
      50% {
        transform: scale(0.95);
        box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.3);
      }
      100% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
      }
    }
    .reason-item-flex.double-clicked {
      animation: doubleClickPulse 0.5s ease-out;
      background-color: #e6f7ff;
      border: 1px solid #91d5ff;
    }
</style>
pages/ZLGL/QualityReportStep/QualityReportStepBillList.vue
New file
@@ -0,0 +1,557 @@
<template>
    <view class="page" id="pageContent">
        <view class="search-condition-zone">
            <view class="form-item">
                <view class="left">
                    日期:
                </view>
                <view class="daterange" style="flex: 1;">
                    <view class="right general">
                        <uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HBeginDate">
                            <view>{{hform.HBeginDate}}</view>
                        </uni-datetime-picker>
                    </view>
                    <view>—</view>
                    <view class="right general">
                        <uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HEndDate">
                            <view>{{hform.HEndDate}}</view>
                        </uni-datetime-picker>
                    </view>
                </view>
            </view>
            <view class="form-item">
                <view class="left">
                    单据号:
                </view>
                <view class="right general">
                    <input type="text" v-model="hform.HBillNo" />
                </view>
            </view>
        </view>
        <view class="button-zone">
            <button type="default" class="btn-a" size="mini" @tap="cmdAdd">新增</button>
            <button type="default" class="btn-a" size="mini" @tap="cmdSearch">查询</button>
            <button type="default" class="btn-c" size="mini" @tap="exit">退出</button>
        </view>
        <view class="info-list-zone" id="scroll-content" :style="{height: scrollContentHeight + 'px'}">
            <view class="card-item" v-for="(item, index) in listDataShow" :key="index">
                <uni-card :title="item['单据号']" :extra="'日期:' + item['日期'].split('T')[0]"
                    @tap="showDetail = showDetail==index?-1:index">
                    <view class="card-detail">
                        <view
                            class="detail"
                            v-for="(value, key,keyIndex) in item"
                            :key="key"
                            v-if="keyIndex<=10 && shouldShowField(key, value)"
                        >
                            <text>{{ formatFieldName(key) }}:</text>{{ value }}
                        </view>
                    </view>
                    <view class="card-detail" v-if="showDetail == index">
                        <view
                            class="detail"
                            v-for="(value, key,keyIndex) in item"
                            :key="key"
                            v-if="keyIndex>=11 && shouldShowField(key, value)"
                        >
                            <text>{{ formatFieldName(key) }}:</text>{{ value }}
                        </view>
                    </view>
                    <view class="more" v-if="showDetail == index && operations != index">
                        <view class="part" style="border-right: 1px solid #eee;">
                            <uni-icons type="top" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>收起
                        </view>
                        <view class="part" @tap.stop="operations = operations==index?-1:index">
                            <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;"
                                size="14"></uni-icons>操作
                        </view>
                    </view>
                    <view class="more" v-if="showDetail != index && operations != index">
                        <view class="part" style="border-right: 1px solid #eee;">
                            <uni-icons type="bottom" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>更多信息
                        </view>
                        <view class="part" @tap.stop="operations = operations==index?-1:index">
                            <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;"
                                size="14"></uni-icons>操作
                        </view>
                    </view>
                    <view class="op" v-if="operations == index">
                        <button class="op3" size="mini" plain @tap.stop="edit(item)">编辑</button>
                        <button class="op3" size="mini" plain @tap.stop="audit(item, 0)" v-if="!listDataShow[index]['审核人']">审核</button>
                        <button class="op3" size="mini" plain @tap.stop="audit(item, 1)" v-if="listDataShow[index]['审核人']">反审核</button>
                        <button class="op4" size="mini" plain @tap.stop="del(item)">删除</button>
                        <button class="op5" size="mini" plain @tap.stop="operations = -1">取消操作</button>
                    </view>
                </uni-card>
            </view>
            <view class="over" v-if="listDataShow.length == 0">暂无数据</view>
        </view>
        <view class="pagination-zone" id="pagination-zone">
            <uni-pagination show-icon :page-size="paginationMeta.pageSize" :total="paginationMeta.total"
                :current="paginationMeta.current" @change="onPaginationChangeHandler"></uni-pagination>
        </view>
    </view>
</template>
<script>
    import {
        CommonUtils
    } from '@/utils/common'
    import {
        getUserInfo
    } from '@/utils/auth'
    import dayjs, {
        Dayjs
    } from 'dayjs'
    export default {
        data() {
            return {
                navHeight: 0,
                scrollTop: 0,
                showDetail: -1,
                operations: -1,
                hform: {
                    HBeginDate: dayjs(new Date).subtract(30, 'd').format('YYYY-MM-DD'),
                    HEndDate: dayjs(new Date).format('YYYY-MM-DD'),
                    HBillNo: ''
                },
                paginationMeta: {
                    current: 1,
                    total: 0,
                    pageSize: 30,
                },
                pageMeta: {
                    scrollContentTop: 0,
                    bottomBtnTop: 0,
                },
                listData: [],
                listDataShow: [],
            }
        },
        computed: {
            scrollContentHeight: {
                get() {
                    return this.pageMeta.bottomBtnTop - this.pageMeta.scrollContentTop
                }
            }
        },
        methods: {
            // 判断哪些字段需要显示
            shouldShowField(key, value) {
                // 排除不需要显示的字段
                const excludeKeys = ['单据号', '日期']; // 这些字段已经在其他地方显示了
                // 判断key是否全英文(不包含中文)
                const isAllEnglish = /^[a-zA-Z]+$/.test(key);
                // 判断key是否包含"ID"(不区分大小写)
                const containsID = key.toUpperCase().includes('ID');
                return !excludeKeys.includes(key) &&
                       !isAllEnglish && // 排除全英文的key
                       !containsID && // 排除包含ID的key
                       value !== null &&
                       value !== undefined &&
                       value !== '';
            },
            // 格式化字段名显示
            formatFieldName(key) {
                // 你可以根据需求自定义显示名称
                const nameMap = {
                    '物料代码': '物料代码',
                    '物料名称': '物料名称',
                    '规格型号': '规格型号',
                    // ... 其他字段映射
                };
                return nameMap[key] || key;
            },
            exit() {
                uni.navigateBack()
            },
            cmdAdd() {
                uni.redirectTo({
                    url: "/pages/ZLGL/QualityReportStep/QualityReportStepBill"
                })
            },
            async cmdSearch() {
                let sWhere = ''
                if (this.hform.HBeginDate != "" && this.hform.HEndDate != "") {
                    sWhere += " and  CONVERT(varchar(100),日期, 23) between '" + this.hform.HBeginDate + "' and '" +
                        this.hform.HEndDate + "' ";
                }
                if (this.hform.HBillNo != "") {
                    sWhere += " and 单据号 like '%" + this.hform.HBillNo + "%'"
                }
                try {
                    let res = await CommonUtils.doRequest2Sync({
                        url: '/Sc_QualityReportBill/getSc_QualityReportBill',
                        data: {
                            "sWhere": sWhere,
                            "user": getUserInfo()["Czymc"]
                        },
                    })
                    if (!res) {
                        return
                    }
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count > 0) {
                        this.listData = data
                        this.paginationMeta.total = data.length
                        this.onPaginationChangeHandler({
                            current: 1
                        })
                    } else {
                        uni.showToast({
                            icon: 'none',
                            title: Message
                        })
                    }
                } catch (err) {
                    console.warn(err);
                    uni.showToast({
                        title: '接口请求失败:' + err,
                        icon: 'none'
                    })
                }
            },
            async onPaginationChangeHandler({
                current
            }) {
                this.listDataShow =
                    this.listData.slice((current - 1) * this.paginationMeta.pageSize,
                        current * this.paginationMeta.pageSize)
            },
            async audit(item, mode) {
                console.log('审核单据: ',item);
                try{
                    let res = await CommonUtils.doRequest2Sync({
                        method: 'GET',
                        url: '/Sc_QualityReportBill/AuditSc_QualityReportBill',
                        data: {
                            HInterID: item["hmainid"],
                            IsAudit: mode,
                            CurUserName: getUserInfo()["Czymc"]
                        }
                    })
                    if(!res) {
                        return
                    }
                    let {count, data, Message} = res.data
                    if(count == 1) {
                        CommonUtils.showTips({
                            message: `${item["审核人"]?'反审核':'审核'}成功`
                        })
                        this.$forceUpdate()
                        setTimeout(() => {
                            this.cmdSearch()
                        }, 2000)
                    }else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: `单据${item["审核人"]?'反审核':'审核'}失败: ${Message}`
                        })
                    }
                }catch(err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: `单据${item["审核人"]?'反审核':'审核'}错误: ${err}`
                    })
                }
            },
            async del(item) {
                console.log("delItem: ", item);
                uni.showModal({
                    title: '提示',
                    content: '确认要删除记录?删除后不能恢复',
                    success: async (res) => {
                        if (res.confirm) {
                            console.log('用户点击确定');
                            try {
                                let res = await CommonUtils.doRequest2Sync({
                                    url: '/Sc_QualityReportBill/DropSc_QualityReportBill',
                                    data: {
                                        "HInterID": item.hmainid,
                                        "user": getUserInfo()["Czymc"]
                                    }
                                })
                                if (!res) {
                                    return
                                }
                                let {
                                    count,
                                    code,
                                    Message
                                } = res.data
                                if (count == 0) {
                                    return uni.showModal({
                                        title: '错误提示',
                                        content: `删除错误: ${Message}`,
                                        showCancel: false
                                    })
                                }
                                uni.showToast({
                                    title: '删除成功',
                                    icon: 'none'
                                })
                                this.cmdSearch()
                            } catch (err) {
                                uni.showModal({
                                    title: '错误提示',
                                    content: `接口请求失败: ${err}`,
                                    showCancel: false
                                })
                            }
                        }
                    },
                })
            },
            edit(item) {
                console.log("editItem:", item)
                // uni.navigateTo({
                //     url: `/pages/ZLGL/mojianjianyan/lastPieceCheckBill?operationType=3&linterid=${item.hmainid}`
                // })
            }
        },
        onShow() {
            this.$nextTick(() => {
                this.cmdSearch()
            })
        },
        onReady() {
            // #ifndef MP-WEIXIN
            let query = uni.createSelectorQuery().in(this)
            query.select("#scroll-content").boundingClientRect((data) => {
                this.pageMeta.scrollContentTop = data.top
            }).exec()
            query.select("#pagination-zone").boundingClientRect((data) => {
                this.pageMeta.bottomBtnTop = data.top
            }).exec()
            // #endif
            // #ifdef MP-WEIXIN
            // 微信不支持 uni.createSelectorQuery().in(this)
            // #endif
        },
    }
</script>
<style lang="scss" scoped>
    .page {
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        gap: 20rpx;
        padding: 20rpx 0;
        position: relative;
        .button-zone {
            height: auto;
            box-sizing: border-box;
            padding-top: 20rpx;
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            flex-wrap: wrap;
            button {
                border-radius: 50rpx;
                width: 180rpx;
                height: 66rpx;
                line-height: 66rpx;
                font-size: 28rpx;
            }
            .btn-a {
                background-color: #3a78ff;
                color: #fff;
            }
            .btn-c {
                background-color: #ff5722;
                color: #fff;
            }
        }
        .search-condition-zone {
            height: auto;
            box-sizing: border-box;
            padding: 0 60rpx;
            display: flex;
            flex-direction: column;
            gap: 20rpx;
            .form-item {
                display: flex;
                flex-direction: row;
                gap: 20rpx;
                align-items: center;
                font-size: 28rpx;
                .left {
                    width: 4rem;
                }
                .right {
                    flex: 1;
                    padding: 8rpx 16rpx;
                    .search {
                        width: 28rpx;
                        height: 28rpx;
                    }
                    input {
                        font-size: 28rpx;
                    }
                    .uni-combox {
                        padding: 0;
                        margin: 0;
                        ::v-deep .uni-combox__input {
                            font-size: 28rpx;
                            height: auto;
                        }
                    }
                }
                .general {
                    border-radius: 22rpx;
                    border: 1px solid #acacac;
                }
                .disabled {
                    border-radius: 22rpx;
                    border: 1px solid #e4e4e4;
                    background-color: #e4e4e4;
                }
            }
        }
        .info-list-zone {
            overflow-y: auto;
            .card-item {
                .card-detail {
                    width: 100%;
                    display: flex;
                    flex-wrap: wrap;
                    justify-content: space-between;
                    line-height: 120%;
                    .detail {
                        // width: 50%;
                        font-size: 26rpx;
                        margin-bottom: 12rpx;
                        color: #555;
                        margin-right: 20rpx;
                        text {
                            color: #999;
                            font-size: 26rpx;
                        }
                    }
                }
            }
        }
        .daterange {
            display: flex;
            flex-direction: row;
            gap: 10rpx;
            justify-content: center;
            align-items: center;
        }
        .more {
            color: #888;
            font-size: 24rpx;
            display: flex;
            border-top: 1px solid #eee;
            padding-top: 20rpx;
            .part {
                width: 50%;
                text-align: center;
            }
        }
        .op {
            display: flex;
            justify-content: space-between;
            gap: 20rpx;
            margin-top: 20rpx;
            flex-wrap: wrap;
            align-content: flex-start;
            button {
                margin: 0;
                flex-shrink: 0;
                padding: 0;
                width: 150rpx;
                flex-basis: 150rpx;
                font-size: 25rpx;
            }
            .op1 {
                border: 1px solid #41a863;
                color: #41a863;
            }
            .op2 {
                border: 1px solid #d98d00;
                color: #d98d00;
            }
            .op3 {
                border: 1px solid #3a78ff;
                color: #3a78ff;
            }
            .op4 {
                border: 1px solid #da0000;
                color: #da0000;
            }
            .op5 {
                border: 1px solid #888;
                color: #888;
            }
        }
        .pagination-zone {
            position: fixed;
            bottom: 0;
            box-sizing: border-box;
            background-color: #fff;
            box-shadow: 0 2rpx 10rpx 2rpx rgba(0, 0, 0, 0.4);
            padding: 20rpx 40rpx 20rpx 40rpx;
            display: flex;
            flex-direction: column;
            gap: 20rpx;
            justify-content: space-between;
            width: 100%;
        }
    }
</style>
pages/ZLGL/lailiaojianyan/POStockInCheckBill.vue
@@ -631,18 +631,11 @@
                ArrayAnalysisMethodValue: [1, 2, 3],
                // 子表 页签信息
                subTabs: {
                    1: {
                        id: "1",
                        name: "检验项目",
                    0: {
                        id: "0",
                        name: "其他类型",
                    },
                    2: {
                        id: "2",
                        name: "不良原因",
                    },
                    3: {
                        id: "3",
                        name: "抽样检验",
                    },
                },
pages/index/tab2.vue
@@ -465,6 +465,20 @@
                        "url": "/pages/ZLGL/lailiaojianyan_fast/Kf_QCStockInCheckBill_Fast",
                        "id": 55,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "全检检验单",
                        "url": "/pages/ZLGL/QualityReportStep/QualityReportStepBill",
                        "id": 55,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "全检检验单查询",
                        "url": "/pages/ZLGL/QualityReportStep/QualityReportStepBillList",
                        "id": 55,
                        "hidden": false
                    }
                    
                ]
uni_modules/zxz-uni-data-select/components/zxz-uni-data-select/zxz-uni-data-select.vue
@@ -3,9 +3,9 @@
        <!-- hide-on-phone -->
        <span v-if="label" class="uni-label-text">{{label + ':'}}</span>
        <view class="uni-stat-box" :class="{'uni-stat__actived': current}">
            <view class="uni-select" :style="{height:multiple?'100%':' 35px'}"
            <view class="uni-select" :style="{height:multiple?'100%':' 25px'}"
                :class="{'uni-select--disabled':disabled}">
                <view class="uni-select__input-box" :style="{height:multiple?'100%':'35px'}" @click="toggleSelector">
                <view class="uni-select__input-box" :style="{height:multiple?'100%':'25px'}" @click="toggleSelector">
                    <view class="" style="display: flex;flex-wrap: wrap;width: 100%;" v-if="multiple&&current.length>0">
                        <view class="tag-calss"
                            v-for="(item,index) in collapseTags?current.slice(0,collapseTagsNum):current"
@@ -581,6 +581,7 @@
    .uni-stat-box {
        width: 100%;
        flex: 1;
    }
    .uni-stat__actived {
@@ -599,9 +600,11 @@
    .uni-select {
        font-size: 14px;
        border: 1px solid $uni-border-3;
        //border: 1px solid $uni-border-3;
        box-sizing: border-box;
        border-radius: 4px;
        //border-radius: 4px;
        border-radius: 22rpx;
        border: 1px solid #acacac;
        padding: 0 5px;
        padding-left: 10px;
        position: relative;
@@ -615,7 +618,7 @@
        width: 100%;
        flex: 1;
        height: 35px;
        min-height: 35px;
        min-height: 25px;
        &--disabled {
            background-color: #f5f7fa;
utils/common.js
@@ -481,7 +481,7 @@
            FieldListCache = FieldListCache.filter(elem => !role.test(elem.ColmCols))
        })
        
        FieldListCache = FieldListCache.filter(elem => !ExcludeKeys.includes(elem))
        FieldListCache = FieldListCache.filter(elem => !ExcludeKeys.includes(elem.ColmCols))
        return {
            status: true,
            data: FieldListCache,