index.vue
13.4 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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<template>
<div class="gzw content-form">
<el-form ref="form" :model="form" label-width="160px">
<Qlr ref="qlrxxModule" :bsm="bsm"></Qlr>
<table border="1" width="100%" cellspacing="0" cellpadding="0" class="gzwTable">
<tr height="30">
<th colspan="12"><font size="4"></font>构筑物基本信息</th>
</tr>
<tr height="30">
<td colspan="2" align="center" >宗地(海)代码</td>
<td colspan="4" >
<input class="formInput" maxlength="19" v-model="form.zdzhdm" disabled="disabled">
</td>
<td colspan="2" align="center" >项目名称</td>
<td colspan="4" >
<input class="formInput" v-model="form.xmmc" :disabled="form.qszt!=='0'" @blur="inputBlur($event)" ref="xmmc">
</td>
</tr>
<tr height="30">
<td colspan="2" align="center" >坐落</td>
<td colspan="4" >
<input class="formInput" v-model="form.zl" :disabled="form.qszt!=='0'" @blur="inputBlur($event)" ref="zl">
</td>
<td colspan="2" align="center" >不动产单元号</td>
<td colspan="4" class="psr">
<input class="formInput percent80" maxlength="28" v-model="form.bdcdyh" :disabled="form.qszt!=='0'" @blur="inputBlur($event)" ref="bdcdyh">
<el-button @click.prevent="generatorCode" size="mini" class="createBtn" type="warning" :disabled="form.qszt!=='0'">生成</el-button>
</td>
</tr>
<tr height="30">
<td colspan="2" align="center" >构(建)筑物类型</td>
<td colspan="4" >
<el-select-tree style="width:100%"
ref="ghyt"
v-if="show"
:default-expand-all="defaultExpandAll"
:multiple="multiple"
:placeholder="placeholder"
:disabled="form.qszt!='0'"
:data="$store.state.gzwlxList"
:props="treeProps"
:check-strictly="checkStrictly"
:clearable="clearable"
v-model="form.gzwlx"
></el-select-tree>
</td>
<td colspan="2" align="center" >构(建)筑物规划用途</td>
<td colspan="4" >
<input class="formInput percent80" maxlength="28" v-model="form.gzwghyt" :disabled="form.qszt!=='0'">
</td>
</tr>
<tr height="30">
<td colspan="2" align="center">构(建)筑物面积(㎡)</td>
<td colspan="4" >
<input class="formInput" type="number" v-model="form.mj" :disabled="form.qszt!=='0'">
</td>
<td colspan="2" align="center" >竣工日期</td>
<td colspan="4" >
<el-date-picker
style="width:100%"
v-model="form.jgrq"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
:disabled="form.qszt!=='0'">
</el-date-picker>
</td>
</tr>
<tr height="30">
<td colspan="2" rowspan="2" align="center" >
<span>附加说明</span>
</td>
<td colspan="10" rowspan="2" >
<input class="formInput" v-model="form.bz" type="textarea" :disabled="form.qszt!=='0'">
</td>
</tr>
</table>
</el-form>
<div class="header-button">
<el-button type="primary" class="saveBtn" @click="onSave">保存</el-button>
<el-button type="primary" @click="onSubmit">提交</el-button>
<el-button type="primary" @click="registerCall">登记调用</el-button>
</div>
</div>
</template>
<script>
import Qlr from "@components/formMenu/qlr";
import {getQjZdjbxxDetailById} from "@api/zd"
import {submit,registerCall} from "@api/common"
import {getBdcdyh,updateGzwjbxx,getQjGzwDetailInfo} from "@api/gzw";
export default {
name: "index",
components:{
Qlr
},
data(){
return{
//树型结构
show:true,
clearable: true,
defaultExpandAll: true,
multiple: false,
placeholder: '请选择',
disabled: false,
checkStrictly: true,
treeProps: {
value: 'bsm',
children: 'children',
label: 'mc'
},
bsm:'',
form:{
zdzhdm:'',
xmmc:'',
bdcdyh:'',
zl:'',
gzwlx:'',
gzwghyt:'',
mj:'',
jgrq:'',
bz:'',
qszt:0,
bsm:'',
},
zdbsm:'',
rules:[],
}
},
methods:{
getZddm(zdbsm){
getQjZdjbxxDetailById(zdbsm).then((res)=>{
if(res.code===200){
this.form.zdzhdm=res.result.zddm;
console.log(this.form.zdzhdm+"============")
}
})
},
inputBlur(e) {
if (e.target.value != '') {
e.target.style.border = ""
} else {
e.target.style.border = "1px solid red";
e.target.style.boxSizing = 'border-box';
}
},
generatorCode(){
if(this.form.bdcdyh!=null&&this.form.bdcdyh!==''){
this.open();
return;
}
getBdcdyh(this.form.zdzhdm,"gzw")
.then((res)=>{
if(res.code === 200){
this.form.bdcdyh=res.result;
}else {
this.$message.warning(res.message)
}
})
},
open() {
this.$confirm('已经存在不动产单元号, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
getBdcdyh(this.form.zdzhdm,"gzw")
.then((res)=>{
if(res.code === 200){
this.form.bdcdyh=res.result;
this.$message({
type: 'success',
message: '生成成功!'
});
}else {
this.$message.warning(res.message)
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
onSave(){
this.rules=[
{
data:this.form.bdcdyh,
name:'不动产单元号',
dom:this.$refs.bdcdyh,
rule: /^\s*$/g, //非空
},
{
data:this.form.xmmc,
name:'项目名称',
dom:this.$refs.xmmc,
rule: /^\s*$/g, //非空
},
{
data:this.form.zl,
name:'坐落',
dom:this.$refs.zl,
rule: /^\s*$/g, //非空
},
]
let flag = true;
this.rules.forEach(item=>{
if(item.rule.test(item.data) || item.data == null){
if(item.dom.$el){
item.dom.$el.style.border = '1px solid red';
item.dom.$el.style.boxSizing = 'border-box';
}else{
item.dom.style.border = '1px solid red';
item.dom.style.boxSizing = 'border-box';
}
flag = false;
return false
}
})
this.$nextTick(()=> {
if (flag) {
console.log(this.form,'this.form');
this.bsm=this.$route.query.bsm;
this.form.bsm=this.bsm;
this.form.jgsj=this.form.jgrq;
updateGzwjbxx(this.form).then((res)=>{
if(res.code === 200){
this.$message.success("保存完成!");
}
})
}
})
},
getGzwDetailInfo(data){
getQjGzwDetailInfo(data).then((res)=>{
if(res.code === 200){
this.form.xmmc = res.result.xmmc;
this.form.zl = res.result.zl;
this.form.gzwlx = res.result.gzwlx;
this.form.gzwghyt = res.result.gzwghyt;
this.form.mj = res.result.mj;
this.form.jgrq = res.result.jgsj;
this.form.bz = res.result.bz;
this.form.bdcdyh = res.result.bdcdyh;
this.form.qszt = res.result.qszt;
this.zdbsm = res.result.zdzhbsm;
this.getZddm(this.zdbsm);
}
})
},
onSubmit(){
let data={
glbsm:this.bsm,
status:1,
type:"gzw"
}
submit(data).then((res)=>{
if(res.code===200){
this.$message.success("提交完成!");
this.getGzwDetailInfo(this.bsm)
this.getTreeByBsm(this.bsm,'gzw','0,1,2')
}
})
},
registerCall(){
let data={
type:'gzw',
bsm:this.bsm
}
registerCall(data).then(res=>{
if (res.success) {
this.$message.success("登记成功")
this.getTreeByBsm(this.bsm,'gzw','0,1,2')
this.getGzwDetailInfo(this.bsm)
}
})
},
},
created() {
this.bsm = this.$route.query.bsm;
},
mounted() {
this.getGzwDetailInfo(this.bsm);
},
computed: {
gzwbsm() {
return this.$route.query.bsm;
},
},
watch:{
gzwbsm:function (val) {
this.getGzwDetailInfo(val)
this.reload()
},
"form.bdcdyh":function (val) {
if (val != '') {
this.$refs.bdcdyh.style.border = '';
}
},
}
}
</script>
<style rel="stylesheet/less" lang="less" scoped>
.gzw {
box-sizing: border-box;
padding: 18px;
padding-bottom: 0;
/deep/textarea{
width: 100%;
border: 0;
}
.el-form-item{
font-weight: bold;
font-size: xx-large
}
table{
background: #fff;
table-layout: fixed;
}
th {
height: 36px;
line-height: 36px;
font-size: 16px;
}
td{
height: 36px;
width:8.33%;
text-align: right;
padding-right: 10px;
}
.el-select{
width: 100%;
}
table{
font-size: 14px;
}
.gzwTable{
margin-top: 10px;
/deep/.el-input__inner {
margin: 0;
height: 36px;
outline: none;
border: none;
color: #606764;
overflow: visible;
text-align: center;
}
}
}
.header-button{
margin-top: 12px;
text-align: center;
}
</style>