Blame view

src/views/ywbl/ywsq/components/selectDjbbl.vue 7.93 KB
1
<!--
yuanbo committed
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2023-11-16 14:09:32
5
-->
xiaomiao committed
6 7 8 9
<template>
  <div class="from-clues">
    <!-- 表单部分 -->
    <div class="from-clues-header">
10
      <el-form :model="queryForm" ref="queryForm" @submit.native.prevent label-width="100px">
xiaomiao committed
11
        <el-row>
12 13
          <el-col :span="8">
            <el-form-item label="不动产单元号">
xiaomiao committed
14 15 16 17
              <el-input placeholder="请输入不动产单元号" maxlength="28" v-model="queryForm.bdcdyh" clearable class="width100">
              </el-input>
            </el-form-item>
          </el-col>
18 19
          <el-col :span="8">
            <el-form-item label="不动产权证号">
xiaomiao committed
20 21 22 23
              <el-input placeholder="请输入不动产权证号" v-model="queryForm.bdcqzh" clearable class="width100">
              </el-input>
            </el-form-item>
          </el-col>
24
          <el-col :span="8">
xiaomiao committed
25 26 27 28 29
            <el-form-item label="业务号">
              <el-input placeholder="请输入业务号" v-model="queryForm.ywh" clearable class="width100">
              </el-input>
            </el-form-item>
          </el-col>
30
          <el-col :span="8">
xiaomiao committed
31
            <el-form-item label="坐落">
32
              <el-input placeholder="" v-model.trim="queryForm.zl" clearable class="width100">
xiaomiao committed
33 34 35
              </el-input>
            </el-form-item>
          </el-col>
36
          <el-col :span="16" class="btnColRight">
xiaomiao committed
37
            <el-form-item>
38
              <el-button type="primary" @click="handleSearch">查询</el-button>
39
              <el-button type="primary" @click="resetForm(true)">重置</el-button>
xiaomiao committed
40
            </el-form-item>
41
          </el-col>
xiaomiao committed
42 43 44 45
        </el-row>
      </el-form>
    </div>
    <!-- 表格 -->
46
    <div class="from-clues-content loadingtext">
xiaomiao committed
47
      <lb-table ref="table" @row-click="handleRowClick" :page-size="pageData.size" class="loadingtext"
48
        :current-page.sync="pageData.current" :total="tableData.total" @size-change="handleSizeChange" :calcHeight="300"
49
        @p-current-change="handleCurrentChange" @selection-change="handleSelectionChange" :column="tableData.columns" :data="tableData.data">
xiaomiao committed
50 51
      </lb-table>
    </div>
52
    <div class="submit_button">
xiaomiao committed
53
      <el-button @click="$popupCacel">取消</el-button>
54
      <el-button type="primary" plain @click="submitForm" :loading="loading">发起申请</el-button>
xiaomiao committed
55
    </div>
xiaomiao committed
56 57 58
  </div>
</template>
<script>
59 60
  import { mapGetters } from "vuex";
  import store from '@/store/index.js'
61
  import ywsqTable from "@/utils/mixin/ywsqTable";
62
  import { ywPopupDialog } from "@/utils/popup.js";
63
  import { startRepairFlow } from "@/api/workFlow.js";
64
  import { datas, sendThis } from "../javascript/selectDjbbl.js";
yuanbo committed
65
  import { selectRepairQlxx } from "@/api/ywsq.js";
xiaomiao committed
66
  import jump from "../components/mixin/djbbljump";
67 68
  export default {
    name: "djbcx",
69
    mixins: [ywsqTable, jump],
70 71 72 73 74
    mounted () {
      sendThis(this);
      this.queryClick()
    },
    props: {
xiaomiao committed
75 76 77
      isJump: { type: Boolean, default: false },
      sqywInfo: { type: Object, default: () => { } },
    },
78 79
    data () {
      return {
80
        loading: false,
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
        bdcdysz: [],
        queryForm: {
          zl: "",
          bdcdyh: "",
          bdcqzh: "",
          ywh: "",
        },
        pageData: {
          current: 1,
          size: 10,
          total: 0,
        },
        tableData: {
          columns: datas.columns(),
          data: [],
        },
        qllxs: [],
        isDialog: false,
        djbxxData: {},
        bsmSqyw:
xiaomiao committed
101 102 103
          this.sqywInfo.nodetype === "djlx"
            ? this.sqywInfo.bsmSqyw
            : this.sqywInfo.parentid,
104
      };
xiaomiao committed
105
    },
106 107
    methods: {
      // 初始化数据
yuanbo committed
108 109 110 111
      /**
       * @description: 初始化数据
       * @author: renchao
       */
112 113
      queryClick () {
        this.$startLoading()
tianhaohao@pashanhoo.com committed
114
        selectRepairQlxx({ ...this.queryForm, ...this.pageData }).then((res) => {
115 116 117 118 119 120 121 122
          this.$endLoading()
          if (res.code === 200) {
            let { total, records } = res.result;
            this.tableData.data = records;
            this.tableData.total = total;
          }
        });
      },
yuanbo committed
123 124 125 126 127
      /**
       * @description: ywhClick
       * @param {*} item)
       * @author: renchao
       */
128
      ywhClick (item) {
xiaomiao committed
129
        const { href } = this.$router.resolve(
130 131 132 133 134 135 136 137
          "/djbworkFrame?bdcdyid=" +
          item.bdcdyid +
          "&bdcdyh=" +
          item.bdcdyh +
          "&qllx=" +
          item.qllx +
          "&bsmQlxx=" +
          item.bsmQlxx +
xiaomiao committed
138
          "&viewtype=1"
139
        );
xiaomiao committed
140 141 142 143
        localStorage.setItem('ywbl', JSON.stringify(item));
        window.open(href, `urlname${item.bdcdyid}`);

      },
yuanbo committed
144 145 146 147
      /**
       * @description: submitForm
       * @author: renchao
       */
148
      submitForm () {
xiaomiao committed
149 150 151 152
        if (this.bdcdysz.length == 0) {
          this.$message.error("请至少选择一条数据");
          return;
        }
153
        this.loading = true
154
        let from = {
xiaomiao committed
155 156
          bsmSqyw: this.bsmSqyw,
          bdcdysz: this.bdcdysz,
xiaomiao committed
157 158 159
          djqxbm: this.sqywInfo.nodetype == "djlx" ? this.sqywInfo.nodecode : "",
          djqxmc: this.sqywInfo.nodetype == "djlx" ? this.sqywInfo.nodename : "",
        }
tianhaohao@pashanhoo.com committed
160
        startRepairFlow(from).then((res) => {
161
          this.loading = false
xiaomiao committed
162 163 164 165 166 167 168
          if (res.code == 200) {
            this.$message({
              showClose: true,
              message: '发起申请成功',
              type: 'success'
            })
            if (!this.isJump) {
169
              this.jump(res.result)
xiaomiao committed
170 171 172
            } else {
              store.dispatch('user/refreshPage', true);
            }
173
            this.$popupCacel()
xiaomiao committed
174
          } else {
175 176 177 178 179
            if (res.result && res.result.length > 0) {
              ywPopupDialog("申请错误明细", "components/ywdialog", { result: res.result }, '36%', true)
            } else {
              ywPopupDialog("申请错误明细", "components/ywdialog", { message: res.message }, '36%', true)
            }
xiaomiao committed
180
          }
181 182
        }).catch(() => {
          this.loading = false
xiaomiao committed
183 184
        })
      },
yuanbo committed
185 186 187 188 189
      /**
       * @description: handleSelectionChange
       * @param {*} val
       * @author: renchao
       */
xiaomiao committed
190
      handleSelectionChange (val) {
191 192 193 194 195 196 197 198 199
        if (this.sqywInfo.sqywdylx == "1") {
          if (val.length > 1) {
            this.bdcdysz = [...val[val.length - 1]];
          } else {
            this.bdcdysz = val;
          }
        } else {
          this.bdcdysz = val;
        }
xiaomiao committed
200
      },
yuanbo committed
201 202 203 204 205
      /**
       * @description: handleRowClick
       * @param {*} row
       * @author: renchao
       */
206
      handleRowClick (row) {
xiaomiao committed
207
        // 如果状态是1,那就是单选
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
        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 {
xiaomiao committed
227
          this.$refs.table.toggleRowSelection(row);
228
        }
xiaomiao committed
229
      },
230 231 232 233 234
      /**
       * @description: openBook
       * @param {*} row
       * @author: renchao
       */
xiaomiao committed
235
      openDialog (row) {
236 237 238 239 240 241
        var param = {
          bdcdyid: row.bdcdyid,
          qllx: row.qllx,
          bdcdyh: row.bdcdyh,
          bsmQlxx: row.bsmQlxx,
        };
242 243
        ywPopupDialog("登记簿详情", "registerBook/djbFrame", param, '80%', true)
      }
244
    }
xiaomiao committed
245 246 247 248 249 250
  }
</script>
<style scoped lang="scss">
  @import "~@/styles/mixin.scss";
  @import "~@/styles/public.scss";

251 252 253
  .icon-circle {
    position: relative;
  }
xiaomiao committed
254

255 256 257 258 259 260 261 262 263
  .icon-circle::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #000;
    top: 0px;
    left: 0px;
  }
xiaomiao committed
264
</style>