liuying
2024-11-11 62ec1f19c3444695e21f1fe97472261ce3082075
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
<template>
    <view class="content">
        <!-- 顶部标题 -->
        <view class="title">{{title}}</view>
        <view class="detail">
            <view v-for="item in propArr" :key="item.code" class="item">
                <view class="item_title" v-if="item.code!='qualityErrorInfo'||item.code=='qualityErrorInfo'&&content.qualityStateName!='合格'">{{item.title}}</view>
                <view  class="item_content" v-if="item.code=='workingProcedureCurrent'"><a @click="showWorkingProcedure">{{content.workingProcedureCurrent}}</a></view>
                <view  class="item_content" v-else-if="item.code=='qualityErrorInfo'&&content.qualityStateName!='合格'">{{content[item.code]}}</view>
                <view  class="item_content" v-else>{{content[item.code]}}</view>
            </view>
        </view>
        <easy-picker :visible.sync="workingProcedureVisible" :list="workingProcedureList" value-field="value" label-field="label" @select="onChangeInputUser"></easy-picker>
    </view>
</template>
 
<script>
    import EasyPicker from '@/components/EasyPicker.vue'
    import {listbycode} from '@/api/common/index.js'
    export default {
        components:{EasyPicker},
        props: {
            title: {type:String,required: true},
            content: {type: Object,required: true},
            propArr: {type: Array,required: true}
        },
        data() {
            return {
                workingProcedureVisible:false,
                workingProcedureList:[]
            }
        },
        created() {
            this.getListbycode()
            console.log(this.title,'title')
            console.log(this.content)
            console.log(this.propArr)
        },
        methods: {
            showWorkingProcedure(){
                this.workingProcedureVisible=true
            },
            async getListbycode(){
                try{
                    let {data}=await listbycode({code:'process_type'})
                    this.workingProcedureList=data
                }catch(e){
                    //TODO handle the exception
                    console.log(e);
                }
                
            },
            onChangeInputUser(val,valObj,index){
                this.$emit('changeWPCurrent',val)
            }
        }
    }
</script>
 
<style scoped lang="scss">
    .content {
        width: 96%;
        margin: 18rpx auto;
        .title {
            border-left: 6rpx solid #F18202;
            padding-left: 10rpx;
            box-sizing: border-box;
            font-size: 36rpx;
            margin-bottom: 10rpx;
        }
        .detail {
            box-sizing: border-box;
            .item {
                width: 100%;
                background: #fff;
                border-radius: 4rpx;
                display: flex;
                justify-content: center;
                align-items: center;
                padding: 15rpx;
                font-size: 32rpx;
                box-sizing: border-box;
            }
            
            .item_title {
                width: 40%;
            }
            .item_content {
                flex: 1;
                text-align: right;
                color: $color-common;
            }
        }
    }
</style>