小小儁爺
2025-12-30 2b1c5e5c3cfe5ef193364490c293fdf0c7605757
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<template>
    <view>
        <view class="headTitle">浙江优步体育用品股份有限公司工序SOP</view>
        <uni-forms ref="form" :modelValue="form" class="headForm">
            <uni-forms-item label="工单编号" label-width='100' class="headFormItem">
                <uni-easyinput v-model="form.mesordercode" type="text" placeholder="请输入" :clearable='false' />
            </uni-forms-item>
            <uni-forms-item label="产品名称" label-width='100' class="headFormItem">
                <uni-easyinput v-model="form.partname" type="text" placeholder="请输入" :clearable='false' />
            </uni-forms-item>
            <uni-forms-item label="工序sop" label-width='100' class="headFormItem">
                <uni-data-select v-model="form.filepath" :localdata="selectArr" :clearable='false'
                    @change="filepathChange"></uni-data-select>
            </uni-forms-item>
            <uni-forms-item label="版本号" label-width='100' class="headFormItem">
                <uni-easyinput v-model="form.v" type="text" placeholder="请输入" :clearable='false' />
            </uni-forms-item>
        </uni-forms>
 
        <button type="primary" @click="goBack" size="mini" class="goback">返 回</button>
 
 
        <web-view class="my-web-view"
            :src="'https://view.xdocin.com/view?src=' + encodeURIComponent(baseUrl+form.filepath)"></web-view>
 
    </view>
</template>
 
<script>
    export default {
        onLoad(option) {
            this.sopArr = JSON.parse(option.sopArr)
            this.mesOrderObj = JSON.parse(option.mesOrderObj)
        },
        data() {
            return {
                selectArr: [],
                sopArr: [],
                mesOrderObj: {},
                form: {
                    partname: '',
                    mesordercode: '',
                    filepath: '',
                    v: ''
                },
                baseUrl: this.$baseUrl.split('api')[0],
            }
        },
 
        mounted() {
            this.selectArr = this.sopArr.map(({
                filename,
                filepath
            }) => ({
                text: filename,
                value: filepath
            }))
            this.form = {
                partname: this.mesOrderObj.partname,
                mesordercode: this.mesOrderObj.wo_code,
                filepath: this.sopArr[0].filepath,
                v: this.sopArr[0].version
            }
        },
        methods: {
            filepathChange(val) {
                console.log(val)
            },
            goBack() {
                // uni.navigateBack()
                uni.navigateTo({
                    url: './index'
                })
            }
        }
 
    }
</script>
 
<style scoped>
    .goback {
        position: absolute;
        right: 3vw;
        top: 6.5vh;
    }
 
    .my-web-view {
        height: 86vh;
        margin-top: 13vh;
 
    }
 
    .headTitle {
        height: 6vh;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 40rpx;
        font-weight: bolder;
        font-family: Arial;
    }
 
    .headForm {
        height: 6vh;
        border-bottom: 2rpx solid #000;
 
        span {
            display: flex;
            justify-content: space-evenly;
            align-items: center;
        }
 
        .headFormItem {
            width: 500rpx;
        }
 
        .uniui-clear {
            display: none;
        }
    }
</style>