Blame view

src/views/ywbl/ywsq/components/selectDjbbl.vue 6.76 KB
xiaomiao committed
1 2 3 4 5 6
<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
7
          <el-col :span="10">
xiaomiao committed
8 9 10 11 12
            <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
13
          <el-col :span="10">
xiaomiao committed
14 15 16 17 18 19 20 21 22 23 24
            <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
25 26 27 28 29 30
          <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
31 32
          <el-col :span="4" class="btnColRight">
            <el-form-item>
33 34
              <el-button type="primary" @click="resetForm(true)">重置</el-button>
              <el-button type="primary" @click="handleSearch">查询</el-button>
xiaomiao committed
35
            </el-form-item>
36
          </el-col>
xiaomiao committed
37 38 39 40
        </el-row>
      </el-form>
    </div>
    <!-- 表格 -->
41
    <div class="from-clues-content loadingtext">
xiaomiao committed
42
      <lb-table ref="table" @row-click="handleRowClick" :page-size="pageData.size" class="loadingtext"
xiaomiao committed
43
        :current-page.sync="pageData.current" :total="tableData.total" @size-change="handleSizeChange"
44
        @p-current-change="handleCurrentChange" @selection-change="handleSelectionChange" :column="tableData.columns" :data="tableData.data">
xiaomiao committed
45 46
      </lb-table>
    </div>
47
    <div class="submit_button">
xiaomiao committed
48 49 50
      <el-button @click="$popupCacel">取消</el-button>
      <el-button type="primary" plain @click="submitForm">发起申请</el-button>
    </div>
xiaomiao committed
51 52 53
  </div>
</template>
<script>
54 55 56 57 58
  import { mapGetters } from "vuex";
  import { startRepairFlow } from "@/api/ywbl.js";
  import store from '@/store/index.js'
  import table from "@/utils/mixin/table";
  import { datas, sendThis } from "../javascript/selectDjbbl.js";
tianhaohao@pashanhoo.com committed
59
  import { selectRepairQlxx } from "@/api/selectQlxx.js";
xiaomiao committed
60
  import jump from "../components/mixin/djbbljump";
61 62 63 64 65 66 67 68
  export default {
    name: "djbcx",
    mixins: [table, jump],
    mounted () {
      sendThis(this);
      this.queryClick()
    },
    props: {
xiaomiao committed
69 70 71
      isJump: { type: Boolean, default: false },
      sqywInfo: { type: Object, default: () => { } },
    },
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
    data () {
      return {
        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
94 95 96
          this.sqywInfo.nodetype === "djlx"
            ? this.sqywInfo.bsmSqyw
            : this.sqywInfo.parentid,
97
      };
xiaomiao committed
98
    },
99 100 101 102
    methods: {
      // 初始化数据
      queryClick () {
        this.$startLoading()
tianhaohao@pashanhoo.com committed
103
        selectRepairQlxx({ ...this.queryForm, ...this.pageData }).then((res) => {
104 105 106 107 108 109 110 111 112 113 114 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;
          }
        });
      },
      // 高级查询
      moreQueryClick () { },
      // openDialog (scroll) {
      //   this.$popupDialog('登记簿详情', 'registerBook/djbFrame', scroll, '85%');
      // },
      // handleLpbClick (item) {
      //   this.$popupDialog('楼盘表', 'lpb/index', {
      //     bsm: ''
      //   }, '85%')
      // },
      ywhClick (item) {
xiaomiao committed
123
        const { href } = this.$router.resolve(
124 125 126 127 128 129 130 131
          "/djbworkFrame?bdcdyid=" +
          item.bdcdyid +
          "&bdcdyh=" +
          item.bdcdyh +
          "&qllx=" +
          item.qllx +
          "&bsmQlxx=" +
          item.bsmQlxx +
xiaomiao committed
132
          "&viewtype=1"
133
        );
xiaomiao committed
134 135 136 137
        localStorage.setItem('ywbl', JSON.stringify(item));
        window.open(href, `urlname${item.bdcdyid}`);

      },
138
      submitForm () {
xiaomiao committed
139 140 141 142
        if (this.bdcdysz.length == 0) {
          this.$message.error("请至少选择一条数据");
          return;
        }
143
        let from = {
xiaomiao committed
144 145
          bsmSqyw: this.bsmSqyw,
          bdcdysz: this.bdcdysz,
xiaomiao committed
146 147 148
          djqxbm: this.sqywInfo.nodetype == "djlx" ? this.sqywInfo.nodecode : "",
          djqxmc: this.sqywInfo.nodetype == "djlx" ? this.sqywInfo.nodename : "",
        }
149
        console.log("发起申请传参", from, this.sqywInfo);
tianhaohao@pashanhoo.com committed
150
        startRepairFlow(from).then((res) => {
xiaomiao committed
151 152 153 154 155 156 157 158 159 160 161
          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);
            }
162
            this.$popupCacel()
xiaomiao committed
163 164 165 166 167 168
          } else {
            this.$message.error(res.message);
          }
        })
      },
      handleSelectionChange (val) {
169
        console.log("val", val);
xiaomiao committed
170 171
        this.bdcdysz = val;
      },
172
      handleRowClick (row) {
xiaomiao committed
173
        // 如果状态是1,那就是单选
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
        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
193
          this.$refs.table.toggleRowSelection(row);
194
        }
xiaomiao committed
195
      },
196
    }
xiaomiao committed
197 198 199 200 201 202
  }
</script>
<style scoped lang="scss">
  @import "~@/styles/mixin.scss";
  @import "~@/styles/public.scss";

203 204 205
  .icon-circle {
    position: relative;
  }
xiaomiao committed
206

207 208 209 210 211 212 213 214 215
  .icon-circle::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #000;
    top: 0px;
    left: 0px;
  }
xiaomiao committed
216
</style>