Blame view

src/views/ywbl/slsqxx/jsydsyq/slxx300.vue 13.9 KB
xiaomiao committed
1 2
0
<!--
xiaomiao committed
3
 * @Description:
4
 * @Autor: renchao
5
 * @LastEditTime: 2023-10-10 14:24:08
6
-->
7 8
<template>
  <!-- 受理信息 -->
9
  <div class="slxx">
xiaomiao committed
10 11 12
    <el-form
      :model="ruleForm"
      :rules="rules"
13
      v-Loading="loading"
xiaomiao committed
14 15 16
      ref="ruleForm"
      :label-position="flag ? 'top' : ''"
      :inline="flag"
17
      label-width="120px">
18
      <div class="slxx_con" :class="flag ? 'formMarginBot0' : ''">
19
        <div class="slxx_title title-block">
20
          申请业务信息
21 22 23 24
          <div class="triangle"></div>
        </div>
        <el-row :gutter="10">
          <el-col :span="8">
25
            <el-form-item label="业务号:">
tianhaohao@pashanhoo.com committed
26
              <el-input disabled v-model="ruleForm.flow.ywh"></el-input>
27 28 29
            </el-form-item>
          </el-col>
          <el-col :span="8">
30
            <el-form-item label="受理人员:">
31
              <el-input disabled v-model="ruleForm.slsq.slry"></el-input>
32 33 34
            </el-form-item>
          </el-col>
          <el-col :span="8">
35
            <el-form-item label="受理时间:">
36
              <el-input disabled v-model="ruleForm.slsq.slsj"></el-input>
37 38 39
            </el-form-item>
          </el-col>
        </el-row>
40
        <el-row :gutter="10">
41
          <el-col :span="8">
42
            <el-form-item label="权利类型:">
tianhaohao@pashanhoo.com committed
43
              <el-input disabled v-model="ruleForm.sldy.qllxmc"></el-input>
44 45 46
            </el-form-item>
          </el-col>
          <el-col :span="8">
47
            <el-form-item label="登记类型:">
tianhaohao@pashanhoo.com committed
48
              <el-input disabled v-model="ruleForm.sldy.djlxmc"></el-input>
49 50 51
            </el-form-item>
          </el-col>
          <el-col :span="8">
52
            <el-form-item label="登记情形:">
53
              <el-input disabled v-model="ruleForm.slsq.djqxmc"></el-input>
54 55 56
            </el-form-item>
          </el-col>
        </el-row>
xiaomiao committed
57 58
        <div
          class="slxx_title title-block flex"
59
          style="justify-content: space-between">
60
          不动产单元情况
61
          <el-button @click="compare">变化情况对比+</el-button>
62 63 64
        </div>
        <el-row :gutter="10">
          <el-col :span="8">
65
            <el-form-item label="原不动产权证号:">
66
              <el-input disabled v-model="ruleForm.sldy.ybdcqzsh"></el-input>
67 68 69
            </el-form-item>
          </el-col>
          <el-col :span="8">
70
            <el-form-item label="不动产单元号:">
田浩浩 committed
71
              <el-input disabled v-model="ruleForm.qlxx.bdcdyh"></el-input>
72 73 74
            </el-form-item>
          </el-col>
          <el-col :span="8">
75
            <el-form-item label="权利性质:">
76
              <el-input disabled v-model="ruleForm.zdjbxx.qlxzmc"></el-input>
77 78 79 80 81
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
82
            <el-form-item label="宗地面积:">
83
              <el-input :disabled="!viewEdit" v-model="ruleForm.zdjbxx.zdmj"></el-input>
84 85 86
            </el-form-item>
          </el-col>
          <el-col :span="8">
87
            <el-form-item label="土地用途:">
88
              <el-input :disabled="!viewEdit" v-model="ruleForm.qlxx.ytmc"></el-input>
89 90 91
            </el-form-item>
          </el-col>
          <el-col :span="8">
92
            <el-form-item label="权利设定方式:">
田浩浩 committed
93
              <el-input disabled v-model="ruleForm.zdjbxx.qlsdfsmc"></el-input>
94 95 96 97 98
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
99
            <el-form-item label="取得价格:">
xiaomiao committed
100 101
              <div style="display: flex">
                <el-input
xiaomiao committed
102
                  maxlength="11"
xiaomiao committed
103 104
                  v-model="ruleForm.jsydsyq.qdjg"
                  style="width: 500%"
105
                  oninput="value = (value.match(/^\d*(\.?\d{0,2})/g)[0]) || null"
106
                  :disabled="!viewEdit"></el-input>
蔡俊立 committed
107
                <el-select v-model="ruleForm.jsydsyq.jedw" disabled>
xiaomiao committed
108 109 110 111
                  <el-option
                    v-for="item in dictData['A57']"
                    :key="item.dcode"
                    :label="item.dname"
112
                    :value="item.dcode">
蔡俊立 committed
113 114 115
                  </el-option>
                </el-select>
              </div>
116 117 118 119
            </el-form-item>
          </el-col>

          <el-col :span="16">
120
            <el-form-item label="坐落:">
121
              <el-input :disabled="!viewEdit" v-model="ruleForm.sldy.zl"></el-input>
122 123 124 125 126
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col>
127
            <el-form-item label="附记:" prop="fj">
xiaomiao committed
128
              <el-input
xiaomiao committed
129 130 131
                type="textarea"
                maxlength="500"
                show-word-limit
xiaomiao committed
132
                v-model="ruleForm.jsydsyq.fj"
133
                :disabled="!viewEdit"></el-input>
134 135 136
            </el-form-item>
          </el-col>
        </el-row>
137
        <div class="slxx_title title-block">
xiaomiao committed
138 139 140 141 142
          土地用途
          <div class="triangle"></div>
        </div>
        <tdytTable
          :tableData="ruleForm.tdytqxList"
143
          :ableOperation="viewEdit"
144
          @upDateTdytxxList="upDateTdytxxList" />
145
        <div class="slxx_title title-block">
146 147
          权利人信息
          <div class="triangle"></div>
148
        </div>
149
        <el-row :gutter="10">
150
          <el-col :span="12">
151
            <el-form-item label="共有方式:">
xiaomiao committed
152
              <el-radio-group
153
                :disabled="!viewEdit"
154
                v-model="ruleForm.sldy.gyfs">
155 156 157 158
                <el-radio label="0">单独所有</el-radio>
                <el-radio label="1">共同共有</el-radio>
                <el-radio label="2">按份所有</el-radio>
                <el-radio label="3">其它共有</el-radio>
159 160 161
              </el-radio-group>
            </el-form-item>
          </el-col>
162
          <el-col :span="6" v-show="ruleForm.sldy.gyfs != '0'">
163
            <el-form-item label="是否分别持证:">
xiaomiao committed
164 165
              <el-radio-group
                v-model="ruleForm.sldy.sqfbcz"
xiaomiao committed
166
                :disabled="!viewEdit"
167
                @input="updaterow()">
168 169
                <el-radio :label="1"></el-radio>
                <el-radio :label="0"></el-radio>
170 171 172
              </el-radio-group>
            </el-form-item>
          </el-col>
173 174
          <el-col
            :span="6"
175
            v-show="ruleForm.sldy.sqfbcz == '0' && ruleForm.sldy.gyfs != '0'">
176
            <el-form-item label="持证人:">
xiaomiao committed
177
              <el-select
xiaomiao committed
178
                v-model="czr"
xiaomiao committed
179
                placeholder="持证人"
180
                :disabled="!viewEdit">
xiaomiao committed
181
                <el-option
182 183
                  v-for="(item,index) in czrOptions"
                  :key="index"
184
                  :label="item.sqrmc"
185
                  :value="item.id">
186 187 188 189 190
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
xiaomiao committed
191 192
        <qlrCommonTable
          :tableData="ruleForm.qlrList"
193
          :disabled="viewEdit"
xiaomiao committed
194
          @upDateQlrxxList="upDateQlrxxList"
195
          :gyfs="ruleForm.sldy.gyfs" />
196 197 198 199 200 201
        <div class="slxx_title title-block">
          登记原因
          <div class="triangle"></div>
        </div>
        <el-row :gutter="10">
          <el-col>
202
            <el-form-item label="登记原因:" prop="djyy">
xiaomiao committed
203 204 205
              <el-input
                class="textArea"
                type="textarea"
xiaomiao committed
206 207
                maxlength="500"
                show-word-limit
208
                :disabled="!viewEdit"
209
                v-model="ruleForm.jsydsyq.djyy">
210 211 212 213 214
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </div>
215
      <el-row class="btn" v-if="isSave">
216
        <el-form-item>
217 218 219 220 221 222 223
          <el-button type="primary" @click="onSubmit">保存</el-button>
        </el-form-item>
      </el-row>
    </el-form>
  </div>
</template>
<script>
224 225 226 227 228 229 230 231
  import { mapGetters } from "vuex";
  import ywmix from "@/views/ywbl/mixin/index";
  import qlrCommonTable from "@/views/workflow/components/qlrCommonTable";
  import tdytTable from "@/views/workflow/components/tdytTable";
  import { Init, saveData } from "@/api/workflow/jsydsyqFlow.js";
  export default {
    mixins: [ywmix],
    mounted () {
232 233
      let that = this;
      this.loading = true
234 235 236 237 238 239 240
      this.viewEdit = this.$parent.currentSelectTab.ableOperation;
      this.propsParam = this.$attrs;
      var formdata = new FormData();
      formdata.append("bsmSldy", this.propsParam.bsmSldy);
      formdata.append("djlx", this.propsParam.djlx);
      formdata.append("isEdit", this.viewEdit);
      Init(formdata).then((res) => {
241 242 243
        setTimeout(() => {
          this.loading = false
        }, 200)
244
        if (res.code === 200 && res.result) {
245 246 247 248 249 250 251 252 253
          that.ruleForm = res.result;
          that.ruleForm.qlrList.forEach((item) => {
            item.id = item.bsmSqr
            if (item.sfczr == '1') {
              that.czr = item.bsmSqr
            }
          })
          that.czrOptions = that.ruleForm.qlrList;
          that.isSave = that.viewEdit
254
        } else {
255 256 257 258 259 260
          that.isSave = false
          that.$confirm(res.message, '提示', {
            cancelButtonText: '取消',
            showConfirmButton: false,
            type: 'warning'
          })
261
        }
262 263 264 265
      }).catch(() => {
        this.loading = false
        this.isSave = false
      })
266
    },
267 268 269
    components: { qlrCommonTable, tdytTable },
    computed: {
      ...mapGetters(["dictData", "flag"]),
270
    },
271 272
    data () {
      return {
273 274
        isSave: true,
        loading: false,
275 276 277 278 279 280 281 282 283 284 285
        // 键名转换,方法默认是label和children进行树状渲染
        normalizer (node) {
          //方法
          if (node.children == null || node.children == "null") {
            delete node.children;
          }
          return {
            id: node.dcode,
            label: node.dname,
          };
        },
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300
        //表单是否可操作
        viewEdit: false,
        disabled: true,
        czrOptions: [],
        czr: "",
        ruleForm: {
          slywxx: {},
          qlxx: {},
          zdjbxx: {},
          jsydsyq: {},
        },
        //传递参数
        propsParam: {},
        rules: {},
      };
301
    },
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317
    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) {
318 319 320 321 322 323
        if (!_.isEqual(val, this.ruleForm.qlrList)) {
          this.ruleForm.qlrList = _.cloneDeep(val);
          this.czrOptions = this.ruleForm.qlrList;
        }
        this.num = 0
        this.ruleForm.qlrList.forEach(item => {
324
          if (item.id == this.czr) {
325 326 327 328 329 330
            this.num++
          }
        })
        if (this.num == 0) {
          this.czr = ''
        }
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347
      },
      /**
       * @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) {
348 349
          this.$message({
            showClose: true,
350
            message: "土地用途不能为空",
351 352 353 354
            type: "error",
          });
          return false;
        }
355
        if (this.ruleForm.qlrList.length == 0) {
356 357
          this.$message({
            showClose: true,
358
            message: "请确认权利人信息",
359 360 361 362
            type: "error",
          });
          return false;
        }
363 364 365 366 367 368 369 370 371 372 373

        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";
374
        } else {
375 376
          if (this.ruleForm.qlrList.length <= 1) {
            this.$message({
377
              showClose: true,
378 379
              message:
                "共有方式:共同所有,按份所有,其他所有,权利人必须是两个以上",
380 381 382 383
              type: "error",
            });
            return false;
          }
384 385 386 387
          //是否分别持证
          if (this.ruleForm.sldy.sqfbcz == "1") {
            //是
            this.ruleForm.qlrList.forEach((item, index) => {
388
              item.sfczr = "1";
389 390
            });
          } else {
391
            if (that.czr === '') {
392 393 394 395 396 397
              that.$message({
                showClose: true,
                message: "请选择持证人",
                type: "error",
              });
              return false;
398
            }
399
            this.ruleForm.qlrList.forEach((item, index) => {
400
              if (item.id == that.czr) {
401 402 403 404
                item.sfczr = "1";
              } else {
                item.sfczr = "0";
              }
405
            })
406
          }
xiaomiao committed
407
        }
408 409 410 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
        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",
            });
          }
        });
      },
      /**
       * @description: compare
       * @author: renchao
       */
      compare () {
        console.log("this.ruleForm", this.ruleForm);
        this.$popupDialog(
          this.ruleForm.qlxx.qllxmc,
          "registerBook/comparison",
          {
            bsmQlxx: this.ruleForm.qlxx.bsmQlxx,
            dqqllx: "JSYDSYQ",
          },
          "80%",
          true
        );
      },
xiaomiao committed
442
    },
443
  };
444
</script>
xiaomiao committed
445
<style scoped lang="scss">
446 447
  @import "~@/styles/public.scss";
  @import "~@/styles/slxx/slxx.scss";
448
</style>