comparison.vue
3.2 KB
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
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-07-19 09:52:37
-->
<template>
<div class="djxxTable">
<div class="tableBox">
<div class="title">
{{ title }}
<div class="checkbox">
<el-radio-group v-model="radio" :change="checkChange()">
<el-radio :label="1">所有数据</el-radio>
<el-radio :label="2">只展示变化数据</el-radio>
</el-radio-group>
</div>
</div>
<div class="xxTableBox rollTable">
<!-- 固定前三个 -->
<table class="xxTable">
<tr v-for="(item, colindex) in columns" :key="colindex">
<td>
{{ item.label }}
</td>
<td v-for="(row, index) in tableData" :key="index">
<div
class="setbut"
v-if="item.prop == 'cz' && row.sjlx != '系统数据'"
></div>
<span> {{ row[item.prop] }}</span>
</td>
</tr>
</table>
</div>
</div>
</div>
</template>
<script>
import { datas } from "./qlxxFormData.js";
import { getSjlx } from "@/utils/dictionary.js";
import { getDjbQlxxDiff } from "@/api/djbDetail.js";
export default {
props: {
formData: {
type: Object,
default: {},
},
},
data() {
return {
radio: 1,
title: "变化情况对比",
//列表数据
tableData: [],
//空列值个数
emptycolNum: 1,
//列名称对象
columns: [],
};
},
created() {
console.log("this.formData", this.formData.bsmQlxx);
console.log("this.formData", this.formData.dqqllx);
switch (this.formData.dqqllx) {
case "JSYDSYQ":
this.columns = datas.columns().JSYDSYQ;
break;
case "FDCQ2":
this.columns = datas.columns().FDCQ2;
break;
case "NYDSYQ":
this.columns = datas.columns().NYDSYQ;
break;
case "DYAQ":
this.columns = datas.columns().DYAQ;
break;
case "DYIQ":
this.columns = datas.columns().DYIQ;
break;
case "YGDJ":
this.columns = datas.columns().YGDJ;
break;
case "CFDJ":
this.columns = datas.columns().CFDJ;
break;
case "YYDJ":
this.columns = datas.columns().YYDJ;
break;
}
this.getdata();
},
methods: {
/**
* @description: checkChange
* @author: renchao
*/
getdata() {
getDjbQlxxDiff(this.formData.bsmQlxx).then((res) => {
if (res.code === 200) {
console.log("res", res);
this.tableData = res.result;
this.tableData.map((item) => {
item.sjlx = getSjlx(item.sjlx);
});
console.log("this.tableData", this.tableData);
}
});
}
/**
* @description: getQsztName
* @param {*} code
* @author: renchao
*/,
getQsztName(code) {
let name = "";
for (let item of this.qsztList) {
if (item.value == code) {
name = item.label;
break;
}
}
return name;
},
checkChange() {
console.log("ssss", this.radio);
},
},
};
</script>
<style lang="scss" scoped>
@import "./qlxxCommon.scss";
</style>