Blame view

src/views/ywbl/ywsq/components/selectDjbbl.vue 8.14 KB
1
<!--
yuanbo committed
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2023-08-02 09:58:45
5
-->
xiaomiao committed
6 7 8 9 10 11
<template>
  <div class="from-clues">
    <!-- 表单部分 -->
    <div class="from-clues-header">
      <el-form :model="queryForm" ref="queryForm" @submit.native.prevent label-width="70px">
        <el-row>
xiaomiao committed
12
          <el-col :span="10">
xiaomiao committed
13 14 15 16 17
            <el-form-item label="不动产单元号" label-width="105px">
              <el-input placeholder="请输入不动产单元号" maxlength="28" v-model="queryForm.bdcdyh" clearable class="width100">
              </el-input>
            </el-form-item>
          </el-col>
xiaomiao committed
18
          <el-col :span="10">
xiaomiao committed
19 20 21 22 23 24 25 26 27 28 29
            <el-form-item label="不动产权证号" label-width="105px">
              <el-input placeholder="请输入不动产权证号" v-model="queryForm.bdcqzh" clearable class="width100">
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="5">
            <el-form-item label="业务号">
              <el-input placeholder="请输入业务号" v-model="queryForm.ywh" clearable class="width100">
              </el-input>
            </el-form-item>
          </el-col>
xiaomiao committed
30 31 32 33 34 35
          <el-col :span="6">
            <el-form-item label="坐落">
              <el-input placeholder="" v-model.trim="queryForm.zl" clearable class="width200px">
              </el-input>
            </el-form-item>
          </el-col>
xiaomiao committed
36 37
          <el-col :span="4" class="btnColRight">
            <el-form-item>
38
              <!-- <el-button type="primary" @click="resetForm(true)">重置</el-button> -->
39
              <el-button type="primary" @click="handleSearch">查询</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 61
  import { mapGetters } from "vuex";
  import store from '@/store/index.js'
  import table from "@/utils/mixin/table";
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 69 70 71 72 73 74
  export default {
    name: "djbcx",
    mixins: [table, jump],
    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 123 124 125 126 127 128 129 130 131 132
          this.$endLoading()
          if (res.code === 200) {
            let { total, records } = res.result;
            this.tableData.data = records;
            this.tableData.total = total;
          }
        });
      },
      // 高级查询
      moreQueryClick () { },
      // openDialog (scroll) {
      //   this.$popupDialog('登记簿详情', 'registerBook/djbFrame', scroll, '85%');
      // },
      // handleLpbClick (item) {
      //   this.$popupDialog('楼盘表', 'lpb/index', {
      //     bsm: ''
      //   }, '85%')
      // },
yuanbo committed
133 134 135 136 137
      /**
       * @description: ywhClick
       * @param {*} item)
       * @author: renchao
       */
138
      ywhClick (item) {
xiaomiao committed
139
        const { href } = this.$router.resolve(
140 141 142 143 144 145 146 147
          "/djbworkFrame?bdcdyid=" +
          item.bdcdyid +
          "&bdcdyh=" +
          item.bdcdyh +
          "&qllx=" +
          item.qllx +
          "&bsmQlxx=" +
          item.bsmQlxx +
xiaomiao committed
148
          "&viewtype=1"
149
        );
xiaomiao committed
150 151 152 153
        localStorage.setItem('ywbl', JSON.stringify(item));
        window.open(href, `urlname${item.bdcdyid}`);

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

259 260 261
  .icon-circle {
    position: relative;
  }
xiaomiao committed
262

263 264 265 266 267 268 269 270 271
  .icon-circle::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #000;
    top: 0px;
    left: 0px;
  }
xiaomiao committed
272
</style>