Blame view

src/views/ywbl/slsqxx/tdsyq/slxx.vue 18.4 KB
1
<!--
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2023-10-10 14:32:11
5 6 7 8
-->
<template>
  <!-- 受理信息 -->
  <div class="slxx">
xiaomiao committed
9 10 11
    <el-form
      :model="ruleForm"
      :rules="rules"
12
      v-Loading="loading"
xiaomiao committed
13 14 15
      ref="ruleForm"
      :label-position="flag ? 'top' : ''"
      :inline="flag"
16
      label-width="120px">
17
      <div class="slxx_con" :class="flag ? 'formMarginBot0' : ''">
18
        <div class="slxx_title title-block">
19
          申请业务信息
20 21 22 23
          <div class="triangle"></div>
        </div>
        <el-row :gutter="10">
          <el-col :span="8">
xiaomiao committed
24
            <el-form-item label="业务号:">
25 26 27 28 29
              <el-input disabled v-model="ruleForm.flow.ywh"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="受理人员:">
tianhaohao@pashanhoo.com committed
30
              <el-input disabled v-model="ruleForm.slsq.slry"></el-input>
31 32 33 34
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="受理时间:">
tianhaohao@pashanhoo.com committed
35
              <el-input disabled v-model="ruleForm.slsq.slsj"></el-input>
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="权利类型:">
              <el-input disabled v-model="ruleForm.sldy.qllxmc"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="登记类型:">
              <el-input disabled v-model="ruleForm.sldy.djlxmc"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="登记情形:">
tianhaohao@pashanhoo.com committed
52
              <el-input disabled v-model="ruleForm.slsq.djqxmc"></el-input>
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
            </el-form-item>
          </el-col>
        </el-row>
        <div class="slxx_title title-block">
          不动产单元情况
          <div class="triangle"></div>
        </div>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="宗地代码:">
              <el-input disabled v-model="ruleForm.zdjbxx.zddm"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="不动产单元号:">
              <el-input disabled v-model="ruleForm.zdjbxx.bdcdyh"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="权利性质:">
73
              <el-input disabled v-model="ruleForm.zdjbxx.qlxzmc"></el-input>
74 75 76 77 78 79
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="宗地面积:">
80
              <el-input :disabled="!viewEdit" v-model="ruleForm.zdjbxx.zdmj"></el-input>
81 82 83
            </el-form-item>
          </el-col>
          <el-col :span="8">
84 85
            <el-form-item label="权利设定方式:">
              <el-input disabled v-model="ruleForm.zdjbxx.qlsdfsmc"></el-input>
86 87 88
            </el-form-item>
          </el-col>
          <el-col :span="8">
89
            <el-form-item label="农用地面积:">
90
              <div class="flex">
xiaomiao committed
91
                <el-input
92
                  maxlength="12"
xiaomiao committed
93
                  v-model="ruleForm.tdsyq.nydmj"
94
                  :disabled="!viewEdit"
95
                  oninput="value = (value.match(/^\d*(\.?\d{0,2})/g)[0]) || null"></el-input>
xiaomiao committed
96 97
                <el-select
                  v-model="mjdw"
98
                  :disabled="!viewEdit"
99
                  style="width: 68px">
xiaomiao committed
100 101 102 103
                  <el-option
                    v-for="item in dictData['A7']"
                    :key="item.dcode"
                    :label="item.dname"
104
                    :value="item.dcode">
105 106 107
                  </el-option>
                </el-select>
              </div>
108 109
            </el-form-item>
          </el-col>
110 111
        </el-row>
        <el-row :gutter="10">
112 113
          <el-col :span="8">
            <el-form-item label="耕地面积:">
114
              <div class="flex">
xiaomiao committed
115
                <el-input
116
                  maxlength="12"
xiaomiao committed
117
                  v-model="ruleForm.tdsyq.gdmj"
118
                  :disabled="!viewEdit"
119
                  oninput="value = (value.match(/^\d*(\.?\d{0,2})/g)[0]) || null"></el-input>
xiaomiao committed
120 121
                <el-select
                  v-model="mjdw"
122
                  :disabled="!viewEdit"
123
                  style="width: 68px">
xiaomiao committed
124 125 126 127
                  <el-option
                    v-for="item in dictData['A7']"
                    :key="item.dcode"
                    :label="item.dname"
128
                    :value="item.dcode">
129 130 131
                  </el-option>
                </el-select>
              </div>
132 133 134 135
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="林地面积:">
136
              <div class="flex">
xiaomiao committed
137
                <el-input
138
                  maxlength="12"
xiaomiao committed
139
                  v-model="ruleForm.tdsyq.ldmj"
140
                  :disabled="!viewEdit"
141
                  oninput="value = (value.match(/^\d*(\.?\d{0,2})/g)[0]) || null"></el-input>
xiaomiao committed
142 143
                <el-select
                  v-model="mjdw"
144
                  :disabled="!viewEdit"
145
                  style="width: 68px">
xiaomiao committed
146 147 148 149
                  <el-option
                    v-for="item in dictData['A7']"
                    :key="item.dcode"
                    :label="item.dname"
150
                    :value="item.dcode">
151 152 153
                  </el-option>
                </el-select>
              </div>
154 155 156
            </el-form-item>
          </el-col>
          <el-col :span="8">
157
            <el-form-item label="草地面积:">
158
              <div class="flex">
xiaomiao committed
159
                <el-input
160
                  maxlength="12"
xiaomiao committed
161
                  v-model="ruleForm.tdsyq.cdmj"
162
                  :disabled="!viewEdit"
163
                  oninput="value = (value.match(/^\d*(\.?\d{0,2})/g)[0]) || null"></el-input>
xiaomiao committed
164 165
                <el-select
                  v-model="mjdw"
166
                  :disabled="!viewEdit"
167
                  style="width: 68px">
xiaomiao committed
168 169 170 171
                  <el-option
                    v-for="item in dictData['A7']"
                    :key="item.dcode"
                    :label="item.dname"
172
                    :value="item.dcode">
173 174 175
                  </el-option>
                </el-select>
              </div>
176 177
            </el-form-item>
          </el-col>
178 179
        </el-row>
        <el-row :gutter="10">
180 181
          <el-col :span="8">
            <el-form-item label="其他农用地面积:">
182
              <div class="flex">
xiaomiao committed
183
                <el-input
184
                  maxlength="12"
xiaomiao committed
185
                  v-model="ruleForm.tdsyq.qtnydmj"
186
                  :disabled="!viewEdit"
187
                  oninput="value = (value.match(/^\d*(\.?\d{0,2})/g)[0]) || null"></el-input>
xiaomiao committed
188 189
                <el-select
                  v-model="mjdw"
190
                  :disabled="!viewEdit"
191
                  style="width: 68px">
xiaomiao committed
192 193 194 195
                  <el-option
                    v-for="item in dictData['A7']"
                    :key="item.dcode"
                    :label="item.dname"
196
                    :value="item.dcode">
197 198 199
                  </el-option>
                </el-select>
              </div>
200 201
            </el-form-item>
          </el-col>
202 203
          <el-col :span="8">
            <el-form-item label="建筑使用面积:">
204
              <div class="flex">
xiaomiao committed
205
                <el-input
206
                  maxlength="12"
xiaomiao committed
207
                  v-model="ruleForm.tdsyq.jsydmj"
208
                  :disabled="!viewEdit"
209
                  oninput="value = (value.match(/^\d*(\.?\d{0,2})/g)[0]) || null"></el-input>
xiaomiao committed
210 211
                <el-select
                  v-model="mjdw"
212
                  :disabled="!viewEdit"
213
                  style="width: 68px">
xiaomiao committed
214 215 216 217
                  <el-option
                    v-for="item in dictData['A7']"
                    :key="item.dcode"
                    :label="item.dname"
218
                    :value="item.dcode">
219 220 221
                  </el-option>
                </el-select>
              </div>
222 223
            </el-form-item>
          </el-col>
224 225
          <el-col :span="8">
            <el-form-item label="未利用地面积:">
226
              <div class="flex">
xiaomiao committed
227
                <el-input
228
                  maxlength="12"
xiaomiao committed
229
                  v-model="ruleForm.tdsyq.wlydmj"
230
                  :disabled="!viewEdit"
231
                  oninput="value = (value.match(/^\d*(\.?\d{0,2})/g)[0]) || null"></el-input>
xiaomiao committed
232 233
                <el-select
                  v-model="mjdw"
234
                  :disabled="!viewEdit"
235
                  style="width: 68px">
xiaomiao committed
236 237 238 239
                  <el-option
                    v-for="item in dictData['A7']"
                    :key="item.dcode"
                    :label="item.dname"
240
                    :value="item.dcode">
241 242 243
                  </el-option>
                </el-select>
              </div>
244 245
            </el-form-item>
          </el-col>
246
        </el-row>
247
        <div class="slxx_title title-block">
xiaomiao committed
248 249 250 251 252
          土地用途
          <div class="triangle"></div>
        </div>
        <tdytTable
          :tableData="ruleForm.tdytqxList"
253
          :ableOperation="viewEdit"
254
          @upDateTdytxxList="upDateTdytxxList" />
255 256 257 258 259 260 261
        <div class="slxx_title title-block">
          权利人信息
          <div class="triangle"></div>
        </div>
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="共有方式:">
xiaomiao committed
262
              <el-radio-group
263
                :disabled="!viewEdit"
264
                v-model="ruleForm.sldy.gyfs">
265 266 267 268 269 270 271
                <el-radio label="0">单独所有</el-radio>
                <el-radio label="1">共同共有</el-radio>
                <el-radio label="2">按份所有</el-radio>
                <el-radio label="3">其它共有</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
272
          <el-col :span="6" v-show="ruleForm.sldy.gyfs != '0'">
273
            <el-form-item label="是否分别持证:">
xiaomiao committed
274 275
              <el-radio-group
                v-model="ruleForm.sldy.sqfbcz"
xiaomiao committed
276
                :disabled="!viewEdit"
277
                @input="updaterow()">
xiaomiao committed
278 279
                <el-radio :label="1"></el-radio>
                <el-radio :label="0"></el-radio>
280 281 282
              </el-radio-group>
            </el-form-item>
          </el-col>
xiaomiao committed
283 284
          <el-col
            :span="6"
285
            v-show="ruleForm.sldy.sqfbcz == '0' && ruleForm.sldy.gyfs != '0'">
286
            <el-form-item label="持证人:">
xiaomiao committed
287
              <el-select
xiaomiao committed
288
                v-model="czr"
xiaomiao committed
289
                placeholder="持证人"
290
                :disabled="!viewEdit">
xiaomiao committed
291
                <el-option
292 293
                  v-for="(item, index) in czrOptions"
                  :key="index"
xiaomiao committed
294
                  :label="item.sqrmc"
295
                  :value="item.id">
296 297 298 299 300
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
xiaomiao committed
301 302
        <qlrCommonTable
          :tableData="ruleForm.qlrList"
303
          :disabled="viewEdit"
xiaomiao committed
304 305
          @upDateQlrxxList="upDateQlrxxList"
          :key="key"
306
          :gyfs="ruleForm.sldy.gyfs" />
307 308 309 310 311 312

        <div v-if="ruleForm.ywrList && ruleForm.ywrList.length > 0">
          <div class="slxx_title title-block">
            义务人信息
            <div class="triangle"></div>
          </div>
313
          <ywrCommonTable
xiaomiao committed
314
            v-if="ruleForm.ywrList"
315
            :disabled="viewEdit"
xiaomiao committed
316 317
            :tableData="ruleForm.ywrList"
            :key="key"
318
            @upDateQlrxxList="upDateYwrxxList" />
319 320 321 322 323 324 325 326 327
        </div>

        <div class="slxx_title title-block">
          登记原因
          <div class="triangle"></div>
        </div>
        <el-row :gutter="10">
          <el-col>
            <el-form-item label="登记原因:" prop="djyy">
xiaomiao committed
328 329
              <el-input
                class="textArea"
xiaomiao committed
330 331
                maxlength="500"
                show-word-limit
xiaomiao committed
332
                type="textarea"
333
                :disabled="!viewEdit"
334
                v-model="ruleForm.tdsyq.djyy">
335 336 337 338 339
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </div>
340
      <el-row class="btn" v-if="isSave">
341 342 343 344 345 346 347 348
        <el-form-item>
          <el-button type="primary" @click="onSubmit">保存</el-button>
        </el-form-item>
      </el-row>
    </el-form>
  </div>
</template>
<script>
349 350 351 352 353 354 355 356 357 358 359 360 361 362
  import { mapGetters } from "vuex";
  import ywmix from "@/views/ywbl/mixin/index";
  import { Init, saveData } from "@/api/workflow/tdsyqFlow.js";
  import tdytTable from "@/views/workflow/components/tdytTable";
  import qlrCommonTable from "@/views/workflow/components/qlrCommonTable";
  import ywrCommonTable from "@/views/workflow/components/ywrCommonTable";
  export default {
    mixins: [ywmix],
    components: { qlrCommonTable, tdytTable, ywrCommonTable },
    mounted () {
      this.viewEdit = this.$parent.currentSelectTab.ableOperation;
      this.propsParam = this.$attrs;
      var formdata = new FormData();
      let that = this;
363
      this.loading = true
364 365 366 367
      formdata.append("bsmSldy", this.propsParam.bsmSldy);
      formdata.append("djlx", this.propsParam.djlx);
      formdata.append("isEdit", this.viewEdit);
      Init(formdata).then((res) => {
368 369 370 371
        setTimeout(() => {
          this.loading = false
        }, 200)
        if (res.code === 200) {
372
          that.ruleForm = res.result;
373
          that.ruleForm.qlrList.forEach((item) => {
374
            item.id = item.bsmSqr
375
            if (item.sfczr == '1') {
376
              that.czr = item.bsmSqr
377
            }
378
          })
379 380
          that.czrOptions = that.ruleForm.qlrList;
          that.isSave = that.viewEdit
381 382 383 384 385 386 387 388 389 390 391
        } else {
          this.isSave = false
          this.$confirm(res.message, '提示', {
            cancelButtonText: '取消',
            showConfirmButton: false,
            type: 'warning'
          })
        }
      }).catch(() => {
        this.loading = false
      })
xiaomiao committed
392
    },
393 394
    computed: {
      ...mapGetters(["dictData", "flag"]),
xiaomiao committed
395
    },
396 397
    data () {
      return {
398 399
        isSave: true,
        loading: false,
400 401 402 403 404 405 406 407 408 409 410
        // 键名转换,方法默认是label和children进行树状渲染
        normalizer (node) {
          //方法
          if (node.children == null || node.children == "null") {
            delete node.children;
          }
          return {
            id: node.dcode,
            label: node.dname,
          };
        },
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450
        mjdw: "1",
        value2: {
          id: "520000198407304275",
          user: "史平",
        },
        props: {
          label: "user",
          value: "id",
          keyword: "keyword",
        },
        //表单是否可操作
        viewEdit: true,
        key: 0,
        disabled: true,
        czrOptions: [],
        czr: "",
        ruleForm: {},
        //传递参数
        propsParam: {},
        rules: {},
      };
    },
    methods: {
      /**
       * @description: 更新土地用途信息
       * @param {*} val
       * @author: renchao
       */
      upDateTdytxxList (val) {
        this.ruleForm.tdytqxList && (this.ruleForm.tdytqxList = _.cloneDeep(val));
        this.key++;
      },
      /**
       * @description: 更新权利人信息
       * @param {*} val
       * @author: renchao
       */
      upDateQlrxxList (val) {
        this.ruleForm.qlrList && (this.ruleForm.qlrList = _.cloneDeep(val));
        this.czrOptions = this.ruleForm.qlrList;
451 452
        this.num = 0
        this.ruleForm.qlrList.forEach(item => {
453
          if (item.id == this.czr) {
454 455 456 457
            this.num++
          }
        })
        if (this.num == 0) {
458 459
          this.czr = ''
        }
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485
      },
      /**
       * @description: 更新义务人信息
       * @param {*} val
       * @author: renchao
       */
      upDateYwrxxList (val) {
        this.ruleForm.ywrList && (this.ruleForm.ywrList = _.cloneDeep(val));
        this.key++;
      },
      /**
       * @description: 是否持证人变化
       * @param {*} val
       * @author: renchao
       */
      updaterow () {
        this.czr = "";
      },
      /**
       * @description: onSubmit
       * @author: renchao
       */
      onSubmit () {
        let that = this;
        let arr = this.ruleForm.tdytqxList.filter((item) => !item.yt);
        if (arr.length > 0) {
486 487
          this.$message({
            showClose: true,
488
            message: "土地用途不能为空",
489 490 491 492
            type: "error",
          });
          return false;
        }
493
        if (this.ruleForm.qlrList.length == 0) {
494 495
          this.$message({
            showClose: true,
496
            message: "请确认权利人信息",
497 498 499 500
            type: "error",
          });
          return false;
        }
501 502 503 504 505 506 507 508 509 510 511

        if (this.ruleForm.sldy.gyfs == "0") {
          if (this.ruleForm.qlrList.length > 1) {
            this.$message({
              showClose: true,
              message: "共有方式:单独所有,权利人只能是一个人",
              type: "error",
            });
            return false;
          }
          this.ruleForm.qlrList[0].sfczr = "1";
512
        } else {
513 514
          if (this.ruleForm.qlrList.length <= 1) {
            this.$message({
515
              showClose: true,
516 517
              message:
                "共有方式:共同所有,按份所有,其他所有,权利人必须是两个以上",
518 519 520 521
              type: "error",
            });
            return false;
          }
522 523 524 525
          //是否分别持证
          if (this.ruleForm.sldy.sqfbcz == "1") {
            //是
            this.ruleForm.qlrList.forEach((item, index) => {
526
              item.sfczr = "1";
527
            })
528
          } else {
529
            if (that.czr === '') {
530 531 532
              that.$message({
                showClose: true,
                message: "请选择持证人",
533 534 535
                type: "error"
              })
              return false
536
            }
537
            this.ruleForm.qlrList.forEach((item, index) => {
538
              if (item.id == that.czr) {
539
                item.sfczr = "1"
540
              } else {
541
                item.sfczr = "0"
542
              }
543
            })
544
          }
xiaomiao committed
545
        }
546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566
        /**
         * @description: saveData
         * @author: renchao
         */
        saveData(this.ruleForm).then((res) => {
          if (res.code === 200) {
            this.$message({
              showClose: true,
              message: "保存成功!",
              type: "success",
            });
            this.$store.dispatch("user/refreshPage", true);
          } else {
            this.$message({
              showClose: true,
              message: res.message,
              type: "error",
            });
          }
        });
      },
xiaomiao committed
567
    },
568
  };
569
</script>
xiaomiao committed
570
<style scoped lang="scss">
571 572
  @import "~@/styles/public.scss";
  @import "~@/styles/slxx/slxx.scss";
573
</style>