Blame view

src/views/ywbl/slsqxx/jsydsyq/slxx.vue 15.3 KB
1
<!--
xiaomiao committed
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2023-10-24 17:35:49
5
-->
任超 committed
6
<template>
任超 committed
7
  <!-- 受理信息 -->
jiaozeping@pashanhoo.com committed
8
  <div class="slxx">
xiaomiao committed
9 10 11 12
    <el-form
      :model="ruleForm"
      :rules="rules"
      :class="{ readonly: editDisabled }"
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' : ''">
任超 committed
19
        <div class="slxx_title title-block">
20
          申请业务信息
任超 committed
21 22
          <div class="triangle"></div>
        </div>
任超 committed
23 24
        <el-row :gutter="10">
          <el-col :span="8">
25
            <el-form-item label="业务号:">
xiaomiao committed
26
              <el-input disabled v-model="ruleForm.flow.ywh"></el-input>
任超 committed
27 28 29
            </el-form-item>
          </el-col>
          <el-col :span="8">
30
            <el-form-item label="受理人员:">
xiaomiao committed
31
              <el-input disabled v-model="ruleForm.slsq.slry"></el-input>
任超 committed
32 33 34
            </el-form-item>
          </el-col>
          <el-col :span="8">
35
            <el-form-item label="受理时间:">
xiaomiao committed
36
              <el-input disabled v-model="ruleForm.slsq.slsj"></el-input>
任超 committed
37 38 39 40 41
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
42
            <el-form-item label="权利类型:">
xiaomiao committed
43
              <el-input disabled v-model="ruleForm.sldy.qllxmc"></el-input>
任超 committed
44 45 46
            </el-form-item>
          </el-col>
          <el-col :span="8">
47
            <el-form-item label="登记类型:">
xiaomiao committed
48
              <el-input disabled v-model="ruleForm.sldy.djlxmc"></el-input>
任超 committed
49 50 51
            </el-form-item>
          </el-col>
          <el-col :span="8">
52
            <el-form-item label="登记情形:">
xiaomiao committed
53
              <el-input disabled v-model="ruleForm.slsq.djqxmc"></el-input>
任超 committed
54 55 56
            </el-form-item>
          </el-col>
        </el-row>
任超 committed
57 58 59 60
        <div class="slxx_title title-block">
          不动产单元情况
          <div class="triangle"></div>
        </div>
任超 committed
61 62
        <el-row :gutter="10">
          <el-col :span="8">
63
            <el-form-item label="宗地代码:">
64
              <el-input v-model="ruleForm.zdjbxx.zddm" disabled></el-input>
任超 committed
65 66 67
            </el-form-item>
          </el-col>
          <el-col :span="8">
68
            <el-form-item label="不动产单元号:">
69
              <el-input v-model="ruleForm.sldy.bdcdyh" disabled></el-input>
任超 committed
70 71 72
            </el-form-item>
          </el-col>
          <el-col :span="8">
73
            <el-form-item label="权利性质:">
74
              <treeselect
75
                v-model="ruleForm.zdjbxx.qlxz"
76 77
                noOptionsText="暂无数据"
                :default-expand-level="1"
78
                :disabled="!viewEdit"
79 80 81 82
                placeholder=""
                :normalizer="normalizer"
                :show-count="true"
                :options="dictData['A9']" />
任超 committed
83 84 85 86 87
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
xiaomiao committed
88
            <el-form-item label="使用权面积:">
89
              <div class="flex">
xiaomiao committed
90
                <el-input
xiaomiao committed
91
                  maxlength="12"
92
                  :disabled="!viewEdit"
xiaomiao committed
93
                  v-model="ruleForm.jsydsyq.syqmj"
94
                  oninput="value = (value.match(/^\d*(\.?\d{0,2})/g)[0]) || null"></el-input>
xiaomiao committed
95
                <el-select disabled v-model="mjdw" style="width: 68px">
xiaomiao committed
96 97 98 99
                  <el-option
                    v-for="item in dictData['A7']"
                    :key="item.dcode"
                    :label="item.dname"
100
                    :value="item.dcode">
xiaomiao committed
101 102
                  </el-option>
                </el-select>
103
              </div>
任超 committed
104 105 106
            </el-form-item>
          </el-col>
          <el-col :span="8">
107
            <el-form-item label="权利设定方式:">
108 109 110 111 112 113 114 115
              <el-select v-model="ruleForm.zdjbxx.qlsdfs" :disabled="!viewEdit">
                <el-option
                  v-for="item in dictData['A10']"
                  :key="item.dcode"
                  :label="item.dname"
                  :value="item.dcode">
                </el-option>
              </el-select>
任超 committed
116 117 118
            </el-form-item>
          </el-col>
          <el-col :span="8">
119
            <el-form-item label="取得价格:">
xiaomiao committed
120 121
              <div style="display: flex">
                <el-input
122
                  maxlength="11"
123
                  :disabled="!viewEdit"
xiaomiao committed
124 125
                  v-model="ruleForm.jsydsyq.qdjg"
                  style="width: 500%"
126
                  oninput="value = (value.match(/^\d*(\.?\d{0,2})/g)[0]) || null"></el-input>
127
                <el-select v-model="ruleForm.jsydsyq.jedw" :disabled="!viewEdit">
xiaomiao committed
128 129 130 131
                  <el-option
                    v-for="item in dictData['A57']"
                    :key="item.dcode"
                    :label="item.dname"
132
                    :value="item.dcode">
蔡俊立 committed
133 134 135
                  </el-option>
                </el-select>
              </div>
任超 committed
136 137
            </el-form-item>
          </el-col>
jiaozeping@pashanhoo.com committed
138

任超 committed
139
          <el-col :span="16">
140
            <el-form-item label="坐落:">
141
              <el-input maxlength="100" :disabled="!viewEdit" v-model="ruleForm.sldy.zl"></el-input>
任超 committed
142 143 144 145 146
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col>
147
            <el-form-item label="附记:" prop="fj">
xiaomiao committed
148 149 150
              <el-input
                type="textarea"
                maxlength="500"
151
                :disabled="!viewEdit"
xiaomiao committed
152
                show-word-limit
153
                v-model="ruleForm.jsydsyq.fj"></el-input>
任超 committed
154 155 156
            </el-form-item>
          </el-col>
        </el-row>
157
        <div class="slxx_title title-block">
xiaomiao committed
158 159 160 161
          土地用途
          <div class="triangle"></div>
        </div>
        <tdytTable
162
          :ableOperation="viewEdit"
xiaomiao committed
163
          :tableData="ruleForm.tdytqxList"
164
          @upDateTdytxxList="upDateTdytxxList" />
任超 committed
165 166 167 168
        <div class="slxx_title title-block">
          权利人信息
          <div class="triangle"></div>
        </div>
任超 committed
169
        <el-row :gutter="10">
170
          <el-col :span="12">
171
            <el-form-item label="共有方式:">
xiaomiao committed
172 173
              <el-radio-group
                :disabled="!viewEdit"
174
                v-model="ruleForm.sldy.gyfs">
田浩浩 committed
175 176 177 178
                <el-radio label="0">单独所有</el-radio>
                <el-radio label="1">共同共有</el-radio>
                <el-radio label="2">按份所有</el-radio>
                <el-radio label="3">其它共有</el-radio>
任超 committed
179 180 181
              </el-radio-group>
            </el-form-item>
          </el-col>
182
          <el-col :span="6" v-show="ruleForm.sldy.gyfs != '0'">
183
            <el-form-item label="是否分别持证:">
184 185
              <el-radio-group
                v-model="ruleForm.sldy.sqfbcz"
xiaomiao committed
186
                :disabled="!viewEdit"
187
                @input="updaterow()">
188 189
                <el-radio :label="1"></el-radio>
                <el-radio :label="0"></el-radio>
任超 committed
190 191 192
              </el-radio-group>
            </el-form-item>
          </el-col>
193 194
          <el-col
            :span="6"
195
            v-show="ruleForm.sldy.sqfbcz == '0' && ruleForm.sldy.gyfs != '0'">
196
            <el-form-item label="持证人:">
197
              <el-select
xiaomiao committed
198
                v-model="czr"
199
                placeholder="持证人"
200
                :disabled="!viewEdit">
201
                <el-option
xiaomiao committed
202
                  v-for="(item, index) in czrOptions"
203
                  :key="index"
204
                  :label="item.sqrmc"
205
                  :value="item.id">
任超 committed
206 207 208
                </el-option>
              </el-select>
            </el-form-item>
任超 committed
209 210
          </el-col>
        </el-row>
xiaomiao committed
211 212
        <qlrCommonTable
          :tableData="ruleForm.qlrList"
213
          :disabled="viewEdit"
xiaomiao committed
214 215
          @upDateQlrxxList="upDateQlrxxList"
          :key="key"
216
          :gyfs="ruleForm.sldy.gyfs" />
1  
jiaozeping@pashanhoo.com committed
217

任超 committed
218
        <div v-if="ruleForm.ywrList && ruleForm.ywrList.length > 0">
219 220 221
          <div class="slxx_title title-block">
            义务人信息
            <div class="triangle"></div>
222
          </div>
223
          <ywrCommonTable
xiaomiao committed
224 225 226 227
            v-if="ruleForm.ywrList"
            :disabled="viewEdit"
            :tableData="ruleForm.ywrList"
            :key="key"
228
            @upDateQlrxxList="upDateYwrxxList" />
229 230
        </div>

任超 committed
231 232 233 234
        <div class="slxx_title title-block">
          登记原因
          <div class="triangle"></div>
        </div>
任超 committed
235 236
        <el-row :gutter="10">
          <el-col>
237
            <el-form-item label="登记原因:" prop="djyy">
xiaomiao committed
238 239 240 241 242 243
              <el-input
                class="textArea"
                type="textarea"
                maxlength="500"
                show-word-limit
                :disabled="!viewEdit"
244
                v-model="ruleForm.jsydsyq.djyy">
任超 committed
245
              </el-input>
任超 committed
246 247 248 249
            </el-form-item>
          </el-col>
        </el-row>
      </div>
250
      <el-row class="btn" v-if="isSave">
251
        <el-form-item>
任超 committed
252 253
          <el-button type="primary" @click="onSubmit">保存</el-button>
        </el-form-item>
任超 committed
254 255 256 257 258
      </el-row>
    </el-form>
  </div>
</template>
<script>
259 260 261 262 263
  import { mapGetters } from "vuex";
  import ywmix from "@/views/ywbl/mixin/index";
  import { Init, saveData } from "@/api/workflow/jsydsyqFlow.js";
  import tdytTable from "@/views/workflow/components/tdytTable";
  import qlrCommonTable from "@/views/workflow/components/qlrCommonTable";
264
  import ywrCommonTable from "@/views/workflow/components/ywrCommonTable";
265 266 267
  export default {
    mixins: [ywmix],
    mounted () {
268
      let that = this
269 270 271
      this.viewEdit = this.$parent.currentSelectTab.ableOperation;
      this.propsParam = this.$attrs;
      var formdata = new FormData();
272
      this.loading = true
273 274 275 276
      formdata.append("bsmSldy", this.propsParam.bsmSldy);
      formdata.append("djlx", this.propsParam.djlx);
      formdata.append("isEdit", this.viewEdit);
      Init(formdata).then((res) => {
277 278 279 280
        setTimeout(() => {
          that.loading = false
        }, 200)
        if (res.code === 200) {
281
          that.ruleForm = res.result;
282
          that.ruleForm.qlrList.forEach((item) => {
283 284 285
            item.id = item.bsmSqr
            if (item.sfczr == '1') {
              that.czr = item.bsmSqr
286
            }
287
          })
288
          that.czrOptions = that.ruleForm.qlrList;
289 290 291 292 293 294 295 296 297
          that.isSave = that.viewEdit
        } else {
          that.isSave = false
          that.$confirm(res.message, '提示', {
            cancelButtonText: '取消',
            showConfirmButton: false,
            type: 'warning'
          })
        }
298 299
      }).catch(() => {
        this.loading = false
300
        this.isSave = false
301
      })
302
    },
303
    components: { qlrCommonTable, tdytTable, ywrCommonTable },
304 305 306 307 308 309 310 311 312 313
    computed: {
      ...mapGetters(["dictData", "flag"]),
      // 根据流程判断表单是否为只读
      editDisabled () {
        if (!this.viewEdit) {
          //只读状态
          return true;
        }
        return false;
      },
renchao@pashanhoo.com committed
314
    },
315 316
    data () {
      return {
317
        isSave: true,
318 319 320 321 322 323 324 325 326 327 328
        // 键名转换,方法默认是label和children进行树状渲染
        normalizer (node) {
          //方法
          if (node.children == null || node.children == "null") {
            delete node.children;
          }
          return {
            id: node.dcode,
            label: node.dname,
          };
        },
329
        loading: false,
330 331 332 333 334 335 336 337 338 339 340 341
        mjdw: "1",
        //表单是否可操作
        viewEdit: true,
        czr: "",
        key: 0,
        disabled: true,
        czrOptions: [],
        ruleForm: {},
        //传递参数
        propsParam: {},
        rules: {},
      };
任超 committed
342
    },
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360
    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;
361 362
        this.num = 0
        this.ruleForm.qlrList.forEach(item => {
363
          if (item.id == this.czr) {
364 365 366 367
            this.num++
          }
        })
        if (this.num == 0) {
368 369
          this.czr = ''
        }
370 371 372 373 374 375 376
      },
      /**
       * @description: 是否持证人变化
       * @param {*} val
       * @author: renchao
       */
      updaterow () {
xiaomiao committed
377
        this.czr = "";
378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395
      },
      /**
       * @description: 更新义务人信息
       * @param {*} val
       * @author: renchao
       */
      upDateYwrxxList (val) {
        this.ruleForm.ywrList && (this.ruleForm.ywrList = _.cloneDeep(val));
        this.key++;
      },
      /**
       * @description: onSubmit
       * @author: renchao
       */
      onSubmit () {
        let that = this;
        let arr = this.ruleForm.tdytqxList.filter((item) => !item.yt);
        if (arr.length > 0) {
396 397
          this.$message({
            showClose: true,
398
            message: "土地用途不能为空",
399 400 401 402
            type: "error",
          });
          return false;
        }
403
        if (this.ruleForm.qlrList.length == 0) {
404 405
          this.$message({
            showClose: true,
406
            message: "请确认权利人信息",
407 408 409 410
            type: "error",
          });
          return false;
        }
411 412 413 414 415 416 417 418 419 420
        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";
421
        } else {
422 423
          if (this.ruleForm.qlrList.length <= 1) {
            this.$message({
424
              showClose: true,
425 426
              message:
                "共有方式:共同所有,按份所有,其他所有,权利人必须是两个以上",
427 428 429 430
              type: "error",
            });
            return false;
          }
431 432 433 434
          //是否分别持证
          if (this.ruleForm.sldy.sqfbcz == "1") {
            //是
            this.ruleForm.qlrList.forEach((item, index) => {
435
              item.sfczr = "1";
436 437
            });
          } else {
438
            if (that.czr === '') {
439 440 441 442 443 444
              that.$message({
                showClose: true,
                message: "请选择持证人",
                type: "error",
              });
              return false;
445
            }
446
            this.ruleForm.qlrList.forEach((item, index) => {
447
              if (item.id == that.czr) {
448 449 450 451 452 453
                item.sfczr = "1";
              } else {
                item.sfczr = "0";
              }
            });
          }
xiaomiao committed
454
        }
455 456 457 458
        /**
         * @description: saveData
         * @author: renchao
         */
459
        this.$store.dispatch("user/refreshPage", false);
460 461 462 463 464 465 466 467 468 469 470 471
        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,
472 473
              type: "error"
            })
474
          }
475 476 477 478
        })
      }
    }
  }
任超 committed
479
</script>
xiaomiao committed
480
<style scoped lang="scss">
481 482
  @import "~@/styles/public.scss";
  @import "~@/styles/slxx/slxx.scss";
xiaomiao committed
483
</style>