fdcq1.vue
10.3 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
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
<!--
* @Description:
* @Autor: miaofang
* @LastEditTime: 2023-10-30 10:59:40
-->
<template>
<div class="djxxTable">
<div v-show="false">
<printTemplate
id="boxfdcq"
:tableData="tableData" :render="render" />
</div>
<div class="tableBox">
<div class="title">
{{ title }}
<el-button class="print" v-show="shows" @click="openPrint()">打印</el-button>
<div class="checkbox">
<el-checkbox-group v-model="checkList" @change="checkChange">
<el-checkbox
v-for="item in qsztList"
:key="item.value"
:label="item.value">{{ item.label }}</el-checkbox>
</el-checkbox-group>
</div>
</div>
<div class="xxTableBox rollTable">
<table class="xxTable">
<tr
v-for="(item, colindex) in columns"
:class="judge(item.label) ? 'cols' : ''"
:key="colindex">
<td>
{{ item.label }}
</td>
<td
v-for="(row, index) in tableData"
:key="index"
:class="[
row.qszt == '2' ? 'lishi' : '',
row.qszt == '0' ? 'linshi' : '',
row.qlzt == '4' ? 'linshi' : '',
item.prop == 'qszt' && row.qlzt == '3' ? 'linshiIcon' : '',
item.prop == 'qszt' && row.qlzt == '2' ? 'linshiIcon' : '',
item.prop == 'qszt' && row.qlzt == '1' ? 'xianshiIcon' : '',
item.prop == 'qszt' && row.qlzt == '4' ? 'zhuxiaoIcon' : '',
]">
<div
class="setbut"
v-if="item.prop == 'cz' && row.sjlx != '系统数据'">
<el-button
type="text"
icon="el-icon-edit-outline"
@click="editDialog(row)">编辑</el-button>
<el-button
type="text"
icon="el-icon-edit-outline"
@click="editDialog(row, 'D')">删除</el-button>
</div>
<div class="icon" v-if="item.prop == 'qszt' && row.qlzt == '1'">
有效
</div>
<div class="icon" v-if="item.prop == 'qszt' && row.qlzt == '2'">
正在补录
</div>
<div class="icon" v-if="item.prop == 'qszt' && row.qlzt == '3'">
正在申请
</div>
<div class="icon" v-if="item.prop == 'qszt' && row.qlzt == '4'">
正在注销
</div>
<span v-if="item.prop == 'qszt'">
{{ getQsztName(row[item.prop]) }}
</span>
<el-link v-if=" ['zxywh', 'ywh'].includes(item.prop)"
@click="handleSelectYwh(row, row[item.prop])"
type="primary">{{ row[item.prop] }}</el-link>
<el-tooltip
v-if="['djyy', 'fj'].includes(item.prop)"
effect="dark"
:content="row[item.prop]"
placement="top"
popper-class="tooltip-width">
<span class="ellipsis-line">
{{ row[item.prop] }}
</span>
</el-tooltip>
<span
v-if="
item.prop !== 'zxywh' &&
item.prop !== 'ywh' &&
item.prop !== 'qszt' &&
item.prop !== 'djyy' &&
item.prop !== 'fj' &&
!judge(item.label)
">
{{ getLable(item.prop,row[item.prop]) }}
</span>
<div class="many" v-if="judge(item.label)">
<div
v-for="(label, index) in row.djQlxxFdcqxmDoList"
:key="index">
{{ label[item.prop] }}
</div>
</div>
</td>
<td v-for="count in emptycolNum" class="empty" :key="~count"></td>
</tr>
</table>
</div>
</div>
</div>
</template>
<script>
import Router from '@/router'
import printJS from "print-js";
import store from '@/store/index.js'
import { datas } from "./qlxxFormData.js";
import { getSjlx } from "@/utils/dictionary.js";
import { getFdcq1List } from "@/api/djbDetail.js";
import printTemplate from "./components/printTemplate.vue";
import { getXtParamsByYwh, getBlParamsByYwh } from '@/api/djyw'
export default {
components: {
printTemplate,
},
data () {
return {
printObj: {
id: "box",
//其他配置项,
},
shows: false,
title: "房地产权登记信息(多幢)",
qsztList: datas.columns().qsztList,
checkList: datas.columns().checkList,
//传递参数
propsParam: this.$attrs,
//列表数据
tableData: [],
// 异步传值
datalist: [],
//空列值个数
emptycolNum: datas.columns().emptycolNum,
//列名称对象
columns: datas.columns().FDCQ1,
render: false,
};
},
created () {
this.loadData()
if (this.$parent.addRepairRecord) {
this.columns.unshift({ prop: "cz", label: "操作" });
}
},
methods: {
getLable (prop, label) {
const ztObj = {
0: '否',
1: '是'
};
const strategies = {
sfygdj: (label) => ztObj[label] || label,
sfczjzhxz: (label) => ztObj[label] || label,
dyrlx: (label) => {
let arr = store.getters.dictData['A36'].filter(item => item.dcode === label);
return arr.length > 0 ? arr[0].dname : label;
},
default: (label) => label
};
const strategy = strategies[prop] || strategies.default;
return strategy(label);
},
openPrint () {
this.render = true;
setTimeout(() => {
this.prinsss();
}, 100);
},
/**
* @description: prinsss
* @author: miaofang
*/
prinsss () {
printJS({
printable: "boxfdcq", // // 文档来源:pdf或图像的url,html元素的id或json数据的对象
type: "html",
maxWidth: 800, // 最大宽度
font_size: "", // 不设置则使用默认字体大小
style: `@font-face {
font-family: "STZHONGS";
src: url(${window.ttf}) format("truetype");
}`,
// 继承原来的所有样式
targetStyles: ["*"],
});
this.render = false
},
/**
* @description: loadData
* @author: miaofang
*/
loadData () {
getFdcq1List({
bdcdyid: this.propsParam.bdcdyid,
qllx: this.propsParam.qllx,
qszt: this.checkList,
}).then((res) => {
if (res.code === 200) {
this.tableData = res.result;
this.shows = this.tableData.length > 0;
this.tableData.forEach((item) => {
item.sjlx = getSjlx(item.sjlx);
});
if (this.tableData.length < datas.columns().emptycolNum) {
this.emptycolNum =
datas.columns().emptycolNum - this.tableData.length;
} else {
this.emptycolNum = 0;
}
}
});
},
/**
* @description: checkChange
* @author: miaofang
*/
checkChange () {
if (this.checkList.length === 0) {
this.tableData = [];
this.emptycolNum = datas.columns().emptycolNum;
} else {
this.loadData();
}
},
/**
* @description: getQsztName
* @param {*} code
* @author: miaofang
*/
getQsztName (code) {
let name = "";
for (let item of this.qsztList) {
if (item.value == code) {
name = item.label;
break;
}
}
return name;
},
/**
* @description: judge
* @param {*} lable
* @author: miaofang
*/
judge (label) {
if (
"项目名称幢号总层数规划用途用途名称批准用途实际用途房屋结构房屋结构名称建筑面积竣工时间总套数".indexOf(
label
) > -1
) {
return true;
} else {
return false;
}
},
/**
* @description: 新增一条补录信息
* @param {*} row
* @param {*} del
* @author: miaofang
*/
editDialog (row, del) {
this.$confirm("此操作将新增一条补录信息, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$parent.addRepairRecord(row, del);
this.$message({
type: "success",
message: "补录成功!",
});
})
.catch(() => {
this.$message({
type: "info",
message: "取消编辑",
});
});
},
// 选择业务号
handleSelectYwh (row, ywh) {
let sjlx = row.sjlx,
bsmQlxx = row.bsmQlxx
if (sjlx == '系统数据') {
getXtParamsByYwh(ywh).then(res => {
let data = res.result
const { href } = Router.resolve('/workFrameView?bsmSlsq=' + data.bsmSlsq + '&bsmBusiness=' + data.bsmBusiness)
window.open(href, `urlname${new Date().getTime()}`)
})
} else {
getBlParamsByYwh(ywh, bsmQlxx).then(res => {
let data = res.result
this.$popup('材料信息', 'registerBook/components/clxx/index', {
width: '60%',
formData: data
})
})
}
}
}
};
</script>
<style lang="scss" scoped>
@import "./qlxxCommon.scss";
.cols {
td {
.many {
width: 100%;
height: 100%;
display: flex;
flex-direction: row;
div {
flex: 1;
border-right: 2px solid #e3e2e2;
line-height: 40px;
overflow: unset;
}
div:last-child {
border: 0;
}
}
}
}
.title {
position: relative;
.print {
// background-color: #0079fe;
z-index: 10;
position: absolute;
left: 11px;
top: 5px;
}
}
</style>