Blame view

src/views/ywbl/ywsq/components/selecBdcql.vue 9.95 KB
1
<!--
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2024-02-02 16:36:10
5
-->
田浩浩 committed
6 7 8 9 10
<template>
  <!-- 主体权利信息查询 -->
  <div class="from-clues">
    <!-- 表单部分 -->
    <div class="from-clues-header">
11
      <el-form :model="queryForm" ref="queryForm" label-width="100px">
田浩浩 committed
12
        <el-row>
13 14 15 16
          <el-col :span="8">
            <el-form-item label="业务号">
              <el-input placeholder="请输入业务号" v-model="queryForm.ywh" clearable>
              </el-input>
田浩浩 committed
17 18
            </el-form-item>
          </el-col>
19
          <el-col :span="8">
田浩浩 committed
20
            <el-form-item label="不动产单元号">
21
              <el-input placeholder="请输入不动产单元号" maxlength="28" v-model="queryForm.bdcdyh" clearable>
田浩浩 committed
22 23 24
              </el-input>
            </el-form-item>
          </el-col>
25
          <el-col :span="8">
田浩浩 committed
26
            <el-form-item label="不动产权证号">
27
              <el-input placeholder="请输入不动产权证号全部数字" v-model="queryForm.bdcqzh" clearable>
田浩浩 committed
28 29 30
              </el-input>
            </el-form-item>
          </el-col>
31
          <el-col :span="8">
32 33 34 35 36
            <el-form-item label="权利人">
              <el-input placeholder="请输入权利人" v-model.trim="queryForm.qlr" clearable class="width100">
              </el-input>
            </el-form-item>
          </el-col>
37
          <el-col :span="8">
38 39 40 41 42
            <el-form-item label="证件号">
              <el-input placeholder="请输入证件号" v-model.trim="queryForm.zjh" clearable class="width100">
              </el-input>
            </el-form-item>
          </el-col>
43
          <el-col :span="8" class="btnColRight">
田浩浩 committed
44
            <el-form-item>
yangwei committed
45
              <el-button type="primary" @click="handleSearch">查询</el-button>
46
              <el-button type="primary" @click="resetForm(true)">重置</el-button>
田浩浩 committed
47 48 49 50 51 52
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <!-- 表格 -->
53
    <div class="from-clues-content loadingtext">
54
      <lb-table ref="table" @row-click="handleRowClick" :page-size="pageData.pageSize" :calcHeight="300"
55
        :current-page.sync="pageData.currentPage" :total="tableData.total" @size-change="handleSizeChange" @select="select"
田浩浩 committed
56 57
        @p-current-change="handleCurrentChange" @selection-change="handleSelectionChange" :column="tableData.columns"
        :data="tableData.data">
田浩浩 committed
58 59 60
      </lb-table>
    </div>
    <div class="submit_button">
61
      <el-button @click="$popupCacel">取消</el-button>
62 63
      <el-button type="primary" plain @click="submitForm" :loading="loading" v-if="sqywInfo.isworkFrame">添加单元</el-button>
      <el-button type="primary" plain @click="submitForm" :loading="loading" v-else>发起申请</el-button>
田浩浩 committed
64 65 66 67
    </div>
  </div>
</template>
<script>
68
  import jump from "./mixin/jump";
69
  import store from '@/store/index.js'
70
  import { selectQlxx } from "@/api/ywsq.js";
71
  import ywsqTable from "@/utils/mixin/ywsqTable";
72
  import { ywPopupDialog } from "@/utils/popup.js";
73 74
  import { datas, sendThis } from "../javascript/selecBdcql.js";
  import { defaultParameters } from "../javascript/publicDefaultPar.js";
1  
renchao@pashanhoo.com committed
75
  import { startBusinessFlow, startTogetherFlow, againAddSldy } from "@/api/workFlow.js";
76
  export default {
77
    mixins: [ywsqTable, jump],
78 79 80 81 82 83
    props: {
      isJump: { type: Boolean, default: false },
      sqywInfo: { type: Object, default: () => { } },
    },
    data () {
      return {
84
        loading: false,
85 86 87 88 89 90 91
        queryForm: defaultParameters.defaultParameters(),
        qllxData: [],
        tableData: {
          total: 0,
          columns: datas.columns(),
          data: [],
        },
92
        bdcdysz: [],
93
        qllxList: store.getters.dictData['A8'],
94 95 96 97 98 99
      };
    },
    mounted () {
      sendThis(this);
    },
    methods: {
yuanbo committed
100 101 102 103
      /**
       * @description: 默认加载表格信息
       * @author: renchao
       */
104 105
      queryClick () {
        this.$startLoading();
106
        this.queryForm.bsmSqyw = this.sqywInfo.bsmSqyw;
107 108 109 110 111 112
        selectQlxx({ ...this.queryForm, ...this.pageData }).then((res) => {
          this.$endLoading();
          if (res.code === 200) {
            let { total, records } = res.result;
            this.tableData.total = total;
            this.tableData.data = records;
1  
jiaozeping@pashanhoo.com committed
113
          }
114 115
        });
      },
yuanbo committed
116 117 118 119
      /**
       * @description: submitForm
       * @author: renchao
       */
120
      submitForm () {
1  
renchao@pashanhoo.com committed
121
        let that = this
122 123 124
        if (this.bdcdysz.length == 0) {
          this.$alert("请至少选择一条数据");
          return;
田浩浩 committed
125
        }
126
        this.loading = true;
1  
renchao@pashanhoo.com committed
127 128 129 130 131 132 133 134
        if (this.sqywInfo.isworkFrame) {
          store.dispatch('user/reMenuRefresh', false)
          againAddSldy({
            bsmSqyw: that.sqywInfo.bsmSqyw,
            bdcdysz: that.bdcdysz,
            bsmSlsq: that.sqywInfo.bsmSlsq,
          }).then(res => {
            that.loading = false
135
            if (res.code == 200) {
1  
renchao@pashanhoo.com committed
136 137
              if (this.sqywInfo.sqywdylx != "1") {
                that.bdcdysz = []
138
                that.$refs.table.clearSelection()
139
              }
1  
renchao@pashanhoo.com committed
140
              store.dispatch('user/reMenuRefresh', true)
141
              that.queryClick()
1  
renchao@pashanhoo.com committed
142 143 144 145 146
              that.$message({
                showClose: true,
                message: '添加成功',
                type: 'success'
              })
147 148
            } else {
              that.$message.error(res.message);
149
            }
150
          }).catch(() => {
1  
renchao@pashanhoo.com committed
151
            that.loading = false
152 153
          })
        } else {
1  
renchao@pashanhoo.com committed
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
          if (that.sqywInfo.sqfl == '1') {
            startBusinessFlow({
              bsmSqyw: that.sqywInfo.bsmSqyw,
              bdcdysz: that.bdcdysz,
            }).then((res) => {
              that.loading = false
              if (res.code == 200) {
                that.$message({
                  showClose: true,
                  message: "发起申请成功",
                  type: "success",
                });
                if (!that.isJump) {
                  that.jump(res.result, that.sqywInfo.djywbm);
                } else {
                  store.dispatch('user/refreshPage', true);
                }
                that.$popupCacel()
172
              } else {
1  
renchao@pashanhoo.com committed
173 174 175 176 177
                if (res.result && res.result.length > 0) {
                  ywPopupDialog("申请错误明细", "components/ywdialog", { result: res.result }, '36%', true)
                } else {
                  ywPopupDialog("申请错误明细", "components/ywdialog", { message: res.message }, '36%', true)
                }
178
              }
1  
renchao@pashanhoo.com committed
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
            }).catch(() => {
              this.loading = false
            })
          } else {
            startTogetherFlow({
              bsmSqyw: that.sqywInfo.bsmSqyw,
              bdcdysz: that.bdcdysz,
            }).then((res) => {
              that.loading = false
              if (res.code == 200) {
                that.$message({
                  showClose: true,
                  message: '发起申请成功',
                  type: 'success'
                })
                if (!that.isJump) {
                  that.jump(res.result, that.sqywInfo.djywbm)
                } else {
                  store.dispatch('user/refreshPage', true);
                  that.$popupCacel()
                }
200
              } else {
1  
renchao@pashanhoo.com committed
201 202 203 204 205
                if (res.result && res.result.length > 0) {
                  ywPopupDialog("申请错误明细", "components/ywdialog", { result: res.result }, '36%', true)
                } else {
                  ywPopupDialog("申请错误明细", "components/ywdialog", { message: res.message }, '36%', true)
                }
206
              }
1  
renchao@pashanhoo.com committed
207 208 209 210
            }).catch(() => {
              that.loading = false
            })
          }
211
        }
212
      },
yuanbo committed
213 214 215 216 217
      /**
       * @description: handleSelectionChange
       * @param {*} val
       * @author: renchao
       */
218
      handleSelectionChange (val) {
219 220 221 222 223 224 225 226 227
        if (this.sqywInfo.sqywdylx == "1") {
          if (val.length > 1) {
            this.bdcdysz = [...val[val.length - 1]];
          } else {
            this.bdcdysz = val;
          }
        } else {
          this.bdcdysz = val;
        }
228
      },
yuanbo committed
229 230 231 232 233 234
      /**
       * @description: select
       * @param {*} selection
       * @param {*} row
       * @author: renchao
       */
235 236 237 238 239 240 241 242 243
      select (selection, row) {
        if (this.sqywInfo.sqywdylx == "1") {
          // 清除 所有勾选项
          this.$refs.table.clearSelection()
          // 当表格数据都没有被勾选的时候 就返回
          // 主要用于将当前勾选的表格状态清除
          if (selection.length == 0) return
          this.$refs.table.toggleRowSelection(row, true);
        }
244
      },
yuanbo committed
245 246 247 248 249
      /**
       * @description: handleRowClick
       * @param {*} row
       * @author: renchao
       */
250
      handleRowClick (row) {
251
        // 如果状态是1,那就是单选
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270
        if (this.sqywInfo.sqywdylx == "1") {
          const bdcdysz = this.bdcdysz
          this.$refs.table.clearSelection()
          if (bdcdysz.length == 1) {
            bdcdysz.forEach(item => {
              // 判断 如果当前的一行被勾选, 再次点击的时候就会取消选中
              if (item == row) {
                this.$refs.table.toggleRowSelection(row, false);
              }
              // 不然就让当前的一行勾选
              else {
                this.$refs.table.toggleRowSelection(row, true);
              }
            })
          }
          else {
            this.$refs.table.toggleRowSelection(row, true);
          }
        } else {
271
          this.$refs.table.toggleRowSelection(row);
272
        }
273
      },
274 275 276 277 278
      /**
   * @description: openBook
   * @param {*} row
   * @author: miaofang
   */
279 280 281 282 283 284 285 286 287 288 289 290
      openBook (row) {
        console.log("的急急急急急急");
        var param = {
          bdcdyid: row.bdcdyid,
          qllx: row.qllx,
          bdcdyh: row.bdcdyh,
          bsmQlxx: row.bsmQlxx,
        };
        this.$popup("登记簿详情", "registerBook/djbFrame", {
          formData: param
        })
      },
1  
jiaozeping@pashanhoo.com committed
291
    },
292
  };
田浩浩 committed
293 294
</script>
<style scoped lang="scss">
295 296
  @import "~@/styles/mixin.scss";
  @import "~@/styles/public.scss";
田浩浩 committed
297
</style>