变更情况对比数据处理
Showing
1 changed file
with
56 additions
and
10 deletions
| ... | @@ -18,16 +18,21 @@ | ... | @@ -18,16 +18,21 @@ |
| 18 | <div class="xxTableBox rollTable"> | 18 | <div class="xxTableBox rollTable"> |
| 19 | <!-- 固定前三个 --> | 19 | <!-- 固定前三个 --> |
| 20 | <table class="xxTable"> | 20 | <table class="xxTable"> |
| 21 | <tr v-for="(item, colindex) in columns" :key="colindex"> | 21 | <tr v-for="(item, colindex) in columnsall" :key="colindex"> |
| 22 | <td> | 22 | <td> |
| 23 | {{ item.label }} | 23 | {{ item.label }} |
| 24 | </td> | 24 | </td> |
| 25 | <td v-for="(row, index) in tableData" :key="index"> | 25 | <td v-for="(row, index) in tableData" :key="index" > |
| 26 | <div class="setbut" v-if="item.prop == 'bhqk'"> | ||
| 27 | {{ index?"变化前": "变化后"}} | ||
| 28 | </div> | ||
| 26 | <div | 29 | <div |
| 27 | class="setbut" | ||
| 28 | v-if="item.prop == 'cz' && row.sjlx != '系统数据'" | 30 | v-if="item.prop == 'cz' && row.sjlx != '系统数据'" |
| 29 | ></div> | 31 | ></div> |
| 30 | <span> {{ row[item.prop] }}</span> | 32 | <span v-if="item.prop == 'qszt'" :class="item.bt"> |
| 33 | {{ getQsztName(row[item.prop]) }} | ||
| 34 | </span> | ||
| 35 | <span v-else :class="item.bt"> {{ row[item.prop] }}</span> | ||
| 31 | </td> | 36 | </td> |
| 32 | </tr> | 37 | </tr> |
| 33 | </table> | 38 | </table> |
| ... | @@ -51,17 +56,18 @@ export default { | ... | @@ -51,17 +56,18 @@ export default { |
| 51 | return { | 56 | return { |
| 52 | radio: 1, | 57 | radio: 1, |
| 53 | title: "变化情况对比", | 58 | title: "变化情况对比", |
| 59 | qsztList: datas.columns().qsztList, | ||
| 54 | //列表数据 | 60 | //列表数据 |
| 55 | tableData: [], | 61 | tableData: [], |
| 56 | //空列值个数 | 62 | //空列值个数 |
| 57 | emptycolNum: 1, | 63 | emptycolNum: 1, |
| 58 | //列名称对象 | 64 | //列名称对象 |
| 59 | columns: [], | 65 | columns: [], |
| 66 | columnsall:[], | ||
| 67 | columnsum:[] | ||
| 60 | }; | 68 | }; |
| 61 | }, | 69 | }, |
| 62 | created() { | 70 | created() { |
| 63 | console.log("this.formData", this.formData.bsmQlxx); | ||
| 64 | console.log("this.formData", this.formData.dqqllx); | ||
| 65 | switch (this.formData.dqqllx) { | 71 | switch (this.formData.dqqllx) { |
| 66 | case "JSYDSYQ": | 72 | case "JSYDSYQ": |
| 67 | this.columns = datas.columns().JSYDSYQ; | 73 | this.columns = datas.columns().JSYDSYQ; |
| ... | @@ -91,6 +97,11 @@ export default { | ... | @@ -91,6 +97,11 @@ export default { |
| 91 | this.getdata(); | 97 | this.getdata(); |
| 92 | }, | 98 | }, |
| 93 | methods: { | 99 | methods: { |
| 100 | getArrDifference: function(arr1, arr2){ | ||
| 101 | return arr1.concat(arr2).filter(function(value, i, arr){ | ||
| 102 | return arr.indexOf(value) === arr.lastIndexOf(value); | ||
| 103 | }) | ||
| 104 | }, | ||
| 94 | /** | 105 | /** |
| 95 | * @description: checkChange | 106 | * @description: checkChange |
| 96 | * @author: renchao | 107 | * @author: renchao |
| ... | @@ -98,12 +109,31 @@ export default { | ... | @@ -98,12 +109,31 @@ export default { |
| 98 | getdata() { | 109 | getdata() { |
| 99 | getDjbQlxxDiff(this.formData.bsmQlxx).then((res) => { | 110 | getDjbQlxxDiff(this.formData.bsmQlxx).then((res) => { |
| 100 | if (res.code === 200) { | 111 | if (res.code === 200) { |
| 101 | console.log("res", res); | 112 | this.tableData.push(res.result.currentQlxx) |
| 102 | this.tableData = res.result; | 113 | this.tableData.push(res.result.ssQlxx) |
| 103 | this.tableData.map((item) => { | 114 | this.tableData.map((item) => { |
| 104 | item.sjlx = getSjlx(item.sjlx); | 115 | item.sjlx = getSjlx(item.sjlx); |
| 105 | }); | 116 | }); |
| 106 | console.log("this.tableData", this.tableData); | 117 | for (let key in this.tableData[0]) { |
| 118 | this.columnsum=this.columns.filter((item,index) => { | ||
| 119 | if(this.tableData[1][key]!==this.tableData[0][key]&&this.columns[index].prop==key){ | ||
| 120 | this.columns[index].bt="red" | ||
| 121 | } | ||
| 122 | return this.columns[index].bt=="red" | ||
| 123 | }) | ||
| 124 | } | ||
| 125 | this.columns.unshift({ | ||
| 126 | prop: "bhqk", | ||
| 127 | label: "变化情况" | ||
| 128 | }) | ||
| 129 | this.columnsum.unshift({ | ||
| 130 | prop: "bhqk", | ||
| 131 | label: "变化情况" | ||
| 132 | }) | ||
| 133 | this.columnsall= this.columns | ||
| 134 | |||
| 135 | |||
| 136 | |||
| 107 | } | 137 | } |
| 108 | }); | 138 | }); |
| 109 | } | 139 | } |
| ... | @@ -124,7 +154,13 @@ export default { | ... | @@ -124,7 +154,13 @@ export default { |
| 124 | }, | 154 | }, |
| 125 | 155 | ||
| 126 | checkChange() { | 156 | checkChange() { |
| 127 | console.log("ssss", this.radio); | 157 | if(this.radio==2){ |
| 158 | this.columnsall=this.columnsum | ||
| 159 | |||
| 160 | }else{ | ||
| 161 | this.columnsall=this.columns | ||
| 162 | |||
| 163 | } | ||
| 128 | }, | 164 | }, |
| 129 | }, | 165 | }, |
| 130 | }; | 166 | }; |
| ... | @@ -132,4 +168,14 @@ export default { | ... | @@ -132,4 +168,14 @@ export default { |
| 132 | 168 | ||
| 133 | <style lang="scss" scoped> | 169 | <style lang="scss" scoped> |
| 134 | @import "./qlxxCommon.scss"; | 170 | @import "./qlxxCommon.scss"; |
| 171 | .red{ | ||
| 172 | color: #ff0202; | ||
| 173 | } | ||
| 174 | .black{ | ||
| 175 | color: #000000; | ||
| 176 | } | ||
| 177 | .setbut{ | ||
| 178 | font-weight: 600; | ||
| 179 | color: #ff0202; | ||
| 180 | } | ||
| 135 | </style> | 181 | </style> | ... | ... |
-
Please register or sign in to post a comment