Blame view

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