展杰
2024-07-03 47e9b5822750378cdaf537e70ab8113355c48335
Merge branch 'master' of http://git.gs-mes.com:8080/sjz/pad
已修改4个文件
133 ■■■■■ 文件已修改
manifest.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/inspectionInfo.vue 126 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest.json
@@ -1,6 +1,6 @@
{
    "name" : "MES",
    "appid" : "__UNI__48029C9",
    "appid" : "__UNI__A155799",
    "description" : "",
    "versionName" : "1.2.2",
    "versionCode" : 101,
package.json
@@ -14,5 +14,9 @@
            "前端组件",
            "通用组件"
        ]
    },
    "dependencies": {
        "@dcloudio/uni-ui": "^1.5.5",
        "uview-ui": "^2.0.37"
    }
}
pages/index/index.vue
@@ -1,3 +1,4 @@
<template>
    <view>
        <u-grid :col="3" @click="gotoPage" border>
pages/inspection/inspectionInfo.vue
@@ -75,8 +75,17 @@
                            <label>{{item.OPERATE_MAN}} / {{item.FTYPE}}</label>
                        </u-col>
                    </u-row>
                    <u-button text="生成检验资料" type="primary" :plain="true" style="width: 200px;height: 100px;position: absolute;top: 30%;right: 10%;" @click="generate()"></u-button>
                    <u-button text="生成检验资料" type="primary" :plain="true"
                        style="width: 200px;height: 100px;position: absolute;top: 30%;right: 10%;"
                        @click="generate()"></u-button>
                </view>
                <view class="container">
                    <button @click="fetchDrawingNumber">查看图号</button>
                </view>
            </uni-card>
        </view>
@@ -114,17 +123,15 @@
                        <u-tag
                            v-if="item.UP_ALLOW && (parseFloat(item.VALUE) <= parseFloat(item.UP_ALLOW) && parseFloat(item.VALUE) >= parseFloat(item.DOWN_ALLOW)) || (!item.UP_ALLOW && item.VALUE == '合格')"
                            text="合格" type="success"></u-tag>
                        <u-tag
                            v-else
                            text="不合格" type="error"></u-tag>
                        <u-tag v-else text="不合格" type="error"></u-tag>
                    </uni-td>
                    <uni-td>
<!--                         <view class="content" @click="useOutClickSide">
                            <easy-select ref="easySelect" size="medium" :value="item.BAD_REASON" @selectOne="selectOne($event,index)"></easy-select>
                        </view> -->
                        <view class="login">
                            <w-select style="margin-left: 20rpx;" v-model='chooseValue' defaultValue="请选择"
                            :list='list' valueName='CONTENT' keyName="ID" @change='change(index)'>
                            <w-select style="margin-left: 20rpx;" v-model='chooseValue' defaultValue="请选择" :list='list'
                                valueName='CONTENT' keyName="ID" @change='change(index)'>
                            </w-select>
                        </view>
                    </uni-td>
@@ -142,6 +149,21 @@
                <u--textarea v-model="remeke" placeholder="请输入内容"></u--textarea>
            </u-row>
        </view>
        <!-- 弹出窗口 -->
        <view v-if="pdfVisible" class="modal">
            <view class="modal-content">
                <view class="modal-header">
                    <text>PDF预览</text>
                    <button @click="closeModal">关闭</button>
                </view>
                <!--             <web-view v-if="pdfLink" :src="pdfLink" class="pdf-view"></web-view> -->
                <view class="pdf-view">
                    <!-- 在此处显示 PDF 内容 -->
                    <iframe :src="pdfLink" width="100%" height="100%"></iframe>
                </view>
            </view>
        </view>
        <u-button text="提交" type="primary" style="margin-top: 10px;" @click="submit()"></u-button>
        <u-toast ref="uToast" />
    </view>
@@ -152,7 +174,7 @@
        getInspectionInfo,
        saveInspectionInfo,
        getBadReason,
        generateInfo
        generateInfoc
    } from '../../api/inspection';
    import {
        baseUrl
@@ -164,6 +186,8 @@
                table: [],
                name: '',
                remeke: '',
                pdfVisible: false, // 在这里声明 pdfVisible
                pdfLink: '', // 也声明 pdfLink,确保它们是响应式的
                //show: false
                chooseValue: "",
                list: []
@@ -304,6 +328,7 @@
                })
            },
            getBadReason() {
                getBadReason().then(res => {
                    console.log(res)
                    if(!res.result) {
@@ -323,8 +348,50 @@
                    }
                }
                return true
            },
            fetchDrawingNumber() {
                let lb = 0;
                if (this.item.ITEM_NO.startsWith('A') || this.item.ITEM_NO.startsWith('B')) {
                    lb = 1;
                } else if (this.item.ITEM_NO.startsWith('C')) {
                    lb = 2;
            }
                const id = this.item.ENGINEERING_NO;
                // lb = 2;
                // const id = 'A3-A010';
                const url = "http://192.168.0.98:808/deviceMessage.ashx?lb='"+lb+"'&id='"+id+"'";
                //const url = `/api/deviceMessage.ashx?lb=${lb}&id=${id}`; // 使用代理路径
                // 打印 URL 进行调试
                console.log("Request URL:", url);
                uni.request({
                    url: url,
                    method: 'POST',
                    success: (response) => {
                        const respData = response.data;
                        if (respData != "") {
                            this.pdfLink = respData;
                            this.pdfVisible = true;
                        } else {
                            uni.showToast({
                                title: respData.msg,
                                icon: 'none'
                            });
        }
                    },
                    fail: (error) => {
                        uni.showToast({
                            title: '请求图号链接失败',
                            icon: 'none'
                        });
                    }
                });
            },
            closeModal() {
                this.pdfVisible = false;
            }
        },
    }
</script>
@@ -353,7 +420,52 @@
    .text {
        font-size: x-large;
    }
    .red{
        color: red;
    }
    .modal {
        display: flex;
        justify-content: center;
        align-items: center;
        position: absolute;
        top: 10%;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }
    .modal-content {
        background-color: white;
        padding: 20px;
        border-radius: 10px;
        width: 80%;
        height: 80%;
    }
    .pdf-view {
        width: 100%;
        height: 100%;
    }
    button {
        background-color: #4CAF50;
        color: white;
        border: none;
        padding: 10px 20px;
        text-align: center;
        text-decoration: none;
        display: inline-block;
        font-size: 16px;
        margin: 4px 2px;
        cursor: pointer;
    }
    button:hover {
        background-color: #45a049;
    }
</style>