Blame view

src/views/ywbl/ywsq/components/nydsyq100.vue 6.9 KB
1
<!--
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2023-08-02 09:58:24
5
-->
蔡俊立 committed
6 7 8 9 10 11 12 13
<template>
  <div class="from-clues">
    <!-- 表单部分 国有建设用地使用权 -->
    <div class="from-clues-header">
      <el-form :model="queryForm" ref="queryForm" label-width="120px">
        <el-row>
          <el-col :span="10">
            <el-form-item label="不动产单元号">
14
              <el-input placeholder="请输入不动产单元号" maxlength="28" v-model="queryForm.bdcdyh" clearable class="width300px">
蔡俊立 committed
15 16 17 18 19
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="坐落">
xiaomiao committed
20
              <el-input placeholder="请输入坐落" v-model.trim="queryForm.zl" clearable class="width300px">
蔡俊立 committed
21 22 23 24 25
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="4" class="btnColRight">
            <el-form-item>
26
              <!-- <el-button type="primary" @click="resetForm(true)">重置</el-button> -->
yangwei committed
27
              <el-button type="primary" @click="handleSearch">查询</el-button>
蔡俊立 committed
28 29 30 31 32 33
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <!-- 表格 -->
34
    <div class="from-clues-content loadingtext">
35
      <lb-table ref="table" @row-click="handleRowClick" :page-size="pageData.pageSize" :calcHeight="300"
36
        :current-page.sync="pageData.currentPage" :total="tableData.total" @size-change="handleSizeChange" @select="select"
蔡俊立 committed
37 38 39 40 41
        @p-current-change="handleCurrentChange" @selection-change="handleSelectionChange" :column="tableData.columns"
        :data="tableData.data">
      </lb-table>
    </div>
    <div class="submit_button">
42
      <el-button @click="$popupCacel">取消</el-button>
43
      <el-button type="primary" plain @click="submitForm" :loading="loading">发起申请</el-button>
蔡俊立 committed
44 45 46 47
    </div>
  </div>
</template>
<script>
48 49 50 51
  //首次登记
  import store from '@/store/index.js'
  import table from "@/utils/mixin/table";
  import jump from "../components/mixin/jump";
52 53 54
  import { ywPopupDialog } from "@/utils/popup.js";
  import { datas, sendThis } from "../javascript/nydsyq100.js";
  import { defaultParameters } from "../javascript/publicDefaultPar.js";
55
  import { selectZdjbxx } from "@/api/ywsq.js";
56
  import { startBusinessFlow } from "@/api/workFlow.js";
57 58 59 60 61 62 63 64
  export default {
    mixins: [table, jump],
    props: {
      isJump: { type: Boolean, default: false },
      sqywInfo: { type: Object, default: () => { } },
    },
    data () {
      return {
65
        loading: false,
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
        queryForm: defaultParameters.defaultParameters(),
        tableData: {
          total: 0,
          columns: datas.columns(),
          data: [],
        },
        bdcdysz: [],
        bsmSqyw:
          this.sqywInfo.nodetype === "djlx"
            ? this.sqywInfo.bsmSqyw
            : this.sqywInfo.parentid,
      };
    },
    mounted () {
      sendThis(this);
    },
    methods: {
yuanbo committed
83 84 85 86
      /**
       * @description: queryClick
       * @author: renchao
       */
87 88 89 90 91 92 93 94 95 96 97
      queryClick () {
        this.$startLoading();
        this.queryForm.sqywbm = this.sqywInfo.djywbm;
        selectZdjbxx({ ...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;
          }
        });
蔡俊立 committed
98
      },
yuanbo committed
99 100 101 102
      /**
       * @description: submitForm
       * @author: renchao
       */
103 104 105 106
      submitForm () {
        if (this.bdcdysz.length == 0) {
          this.$message.error("请至少选择一条数据");
          return;
蔡俊立 committed
107
        }
108
        this.loading = true
109 110 111 112 113 114
        startBusinessFlow({
          bsmSqyw: this.bsmSqyw,
          bdcdysz: this.bdcdysz,
          djqxbm: this.sqywInfo.nodetype == "djqx" ? this.sqywInfo.nodecode : "",
          djqxmc: this.sqywInfo.nodetype == "djqx" ? this.sqywInfo.nodename : "",
        }).then((res) => {
115
          this.loading = false
116 117 118 119 120 121 122 123 124 125 126
          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);
            }
127
            this.$popupCacel()
蔡俊立 committed
128
          } else {
129
            ywPopupDialog("申请错误明细", "components/ywdialog", { message: res.message, result: res.result }, '36%')
蔡俊立 committed
130
          }
131 132
        }).catch(() => {
          this.loading = false
133 134
        })
      },
yuanbo committed
135 136 137 138 139
      /**
       * @description: handleSelectionChange
       * @param {*} val
       * @author: renchao
       */
140
      handleSelectionChange (val) {
141 142 143 144 145 146 147 148 149
        if (this.sqywInfo.sqywdylx == "1") {
          if (val.length > 1) {
            this.bdcdysz = [...val[val.length - 1]];
          } else {
            this.bdcdysz = val;
          }
        } else {
          this.bdcdysz = val;
        }
150
      },
yuanbo committed
151 152 153 154 155 156
      /**
       * @description: select
       * @param {*} selection
       * @param {*} row
       * @author: renchao
       */
157 158 159 160 161 162 163 164 165
      select (selection, row) {
        if (this.sqywInfo.sqywdylx == "1") {
          // 清除 所有勾选项
          this.$refs.table.clearSelection()
          // 当表格数据都没有被勾选的时候 就返回
          // 主要用于将当前勾选的表格状态清除
          if (selection.length == 0) return
          this.$refs.table.toggleRowSelection(row, true);
        }
166
      },
yuanbo committed
167 168 169 170 171
      /**
       * @description: handleRowClick
       * @param {*} row
       * @author: renchao
       */
172
      handleRowClick (row) {
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 {
193
          this.$refs.table.toggleRowSelection(row);
194
        }
195
      },
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
      /**
       * @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
        })
211
      }
蔡俊立 committed
212 213 214 215
    }
  }
</script>
<style scoped lang="scss">
216 217
  @import "~@/styles/mixin.scss";
  @import "~@/styles/public.scss";
蔡俊立 committed
218 219
</style>