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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
| <template>
| <div>
| <el-dialog title="数据查看" :visible.sync="isShow" width="80%" @closed="$emit('closeDataLook')">
| <ul class="tab">
| <li v-for="(m,i) in dataVisibleTitle" :key="i" :class="{active:i===dataVisibleIndex}" @click="handleDataVisibleTab(m,i)">{{m.label}}</li>
| </ul>
| <div style="height: 70vh;overflow-y: auto;">
| <ValueTable ref="ValueTableDataLook" :url="$api.insOrder.selectSampleAndProductByOrderId"
| :key="upIndex"
| :componentData="componentDataDataLook"/>
| </div>
| </el-dialog>
| <un-pass-retest-result :retestVisible="retestVisible" :retestInfo="retestInfo" @closeRetestLook="closeRetestLook" v-if="retestVisible"></un-pass-retest-result>
| </div>
| </template>
|
| <script>
| import ValueTable from "@/components/Table/value-table.vue";
| import UnPassRetestResult from "./unPassRetestResult.vue";
|
| export default {
| name: "dataLookVisible",
| // import 引入的组件需要注入到对象中才能使用
| components: {UnPassRetestResult, ValueTable},
| props: {
| dataDialogVisible: {
| type: Boolean,
| default: () => false
| },
| dataLookInfo: {
| type: Object,
| default: () => {}
| },
| },
| data() {
| // 这里存放数据
| return {
| upIndex: 0,
| isShow: this.dataDialogVisible,
| dataVisibleTitle: [
| {
| label: '进厂检验',
| value: 0
| },
| {
| label: '季度检验',
| value: 1
| },
| ],
| dataVisibleIndex: 0, // 数据查看tab栏选择值
| // 表格数据
| componentDataDataLook: { // 数组查看的table数据
| entity: {
| id: null,
| },
| isIndex: false,
| showSelect: false,
| select: false,
| do: [
| {
| id: '',
| font: '不合格复测查看',
| type: 'text',
| method: 'getRetestResult',
| disabFun: (row, index) => {
| return row.insResult!=0
| }
| }
| ],
| tagField: {
| insState: {
| select: []
| },
| insResult: {
| select: [{
| value: 1,
| label: '合格',
| type: 'success'
| },{
| value: 0,
| label: '不合格',
| type: 'danger'
| },{
| value: 3,
| label: '不判定',
| type: ''
| }]
| }
| },
| selectField: {},
| requiredAdd: [],
| requiredUp: []
| },
| retestVisible: false,
| retestInfo: []
| }
| },
| mounted() {
| this.refreshTable()
| },
| // 方法集合
| methods: {
| // 切换数据查看tab栏
| handleDataVisibleTab (m, i) {
| this.dataVisibleIndex = i
| this.refreshTable()
| },
| // 查询回调
| refreshTable(e) {
| if (this.dataVisibleIndex === 0) {
| this.componentDataDataLook.entity.id = this.dataLookInfo.enterOrderId
| } else {
| this.componentDataDataLook.entity.id = this.dataLookInfo.quarterOrderId
| }
| this.$nextTick(() => {
| this.$refs['ValueTableDataLook'].selectList(e)
| })
| },
| // 查看不合格复测结果
| getRetestResult (row) {
| this.$axios.get(this.$api.insOrder.getRetestResult+'?insProductId='+row.insProductId).then(res => {
| if (res.code == 201) return
| this.retestVisible = true
| this.retestInfo = res.data
| })
| },
| closeRetestLook () {
| this.retestVisible = false
| },
| },
| }
| </script>
|
| <style scoped>
| .tab {
| list-style-type: none;
| display: flex;
| margin-bottom: 12px;
| }
|
| .tab li {
| line-height: 24px;
| padding: 6px 14px;
| font-size: 14px;
| color: #333333;
| border: 1px solid #EEEEEE;
| cursor: pointer;
| }
|
| .tab li:nth-child(1) {
| border-radius: 8px 0 0 8px;
| }
|
| .tab li:nth-child(2) {
| border-radius: 0 8px 8px 0;
| }
|
| .tab li.active {
| border-color: #3A7BFA;
| color: #3A7BFA;
| }
| </style>
|
|