PropertyList.vue 14.4 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430
<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
            <a-form-item label="物业名称">
              <a-input placeholder="请输入物业名称" v-model="queryParam.dataTable"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="入驻时间">
              <a-input placeholder="请选择入驻时间" v-model="queryParam.dataId"></a-input>
            </a-form-item>
          </a-col>

          <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
               <a-col :md="6" :sm="24">
                  <a-button type="primary" @click="searchQuery">查询</a-button>
                  <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
               </a-col>
            </span>
        </a-row>
      </a-form>
    </div>

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-button type="primary" icon="download" @click="handleExportXls('t_property_settled')">导出</a-button>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
      </a-dropdown>
    </div>

    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i>已选择&nbsp;<a style="font-weight: 600">{{
        selectedRowKeys.length }}</a>&nbsp;&nbsp;
        <a style="margin-left: 24px" v-if="selectedRowKeys.length > 0" @click="onClearSelected">清空</a>
      </div>

      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="pagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        @change="handleTableChange"
      >
        <span slot="empowerDate" slot-scope="text, record">
          <span>{{record.empowerBeginDate}}{{record.empowerEndDate}}</span>
        </span>
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>

          <a-divider type="vertical"/>
          <a-dropdown>
            <a class="ant-dropdown-link">
              更多 <a-icon type="down"/>
            </a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a href="javascript:;" @click="handleDetail(record)">详情</a>
              </a-menu-item>

              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)" placement="topLeft">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
        <!-- 字符串超长截取省略号显示 -->
        <span slot="url" slot-scope="text">
          <j-ellipsis :value="text" :length="25"/>
        </span>
        <!-- 字符串超长截取省略号显示-->
        <span slot="component" slot-scope="text">
          <j-ellipsis :value="text"/>
        </span>
      </a-table>

    </div>
    <!-- table区域-end -->

    <property-settled-modal ref="modalForm" @ok="modalFormOk"></property-settled-modal>

    <a-modal
      :title="modalTitle + '入驻物业集团'"
      width="60%"
      :visible="visible"
      :closable="false"
      :maskClosable="false"
    >
      <template slot="footer">
        <a-button @click="close">关闭</a-button>
        <a-button type="primary" @click="onSubmit">确认</a-button>
      </template>

      <a-form-model
        ref="ruleForm"
        :model="form"
        :rules="rules"
        :label-col="labelCol"
        :wrapper-col="wrapperCol"
      >

        <a-card title="物业集团基本信息">
          <a-row>
            <a-col :span="12">
              <a-form-model-item label="物业集团名称" prop="propertyName">
                <a-input
                  v-model="form.propertyName"
                  placeholder="请输入"
                />
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item label="统一信用代码" prop="propertyCode">
                <a-input
                  v-model="form.propertyCode"
                  placeholder="请输入"
                />
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item label="法人代表" prop="legalName">
                <a-input
                  v-model="form.legalName"
                  placeholder="请输入"
                />
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item label="注册资本" prop="registCapital">
                <a-input-number id="inputNumber" v-model="form.registCapital" :min="1" />
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item label="联系人" prop="contactName">
                <a-input
                  v-model="form.contactName"
                  placeholder="请输入"
                />
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item label="联系人电话" prop="contactPhone">
                <a-input
                  v-model="form.contactPhone"
                  placeholder="请输入"
                />
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item label="注册地址" prop="registAdress">
                <a-input
                  v-model="form.registAdress"
                  placeholder="请输入"
                />
              </a-form-model-item>
            </a-col>
            <a-col :span="24">
              <a-form-model-item label="详细地址" prop="adressInfo" :labelCol="{ span: 3 }">
                <a-input
                  v-model="form.adressInfo"
                  placeholder="请输入"
                />
              </a-form-model-item>
            </a-col>
            <a-col :span="21" :offset="3">
              <a-form-model-item label="" :labelCol="{ span: 3 }">
                <div>
                  <div id="container" style="width:100%;height:100%"></div>
                </div>
              </a-form-model-item>
            </a-col>
            <a-col :span="24">
              <a-form-model-item label="集团LOGO" prop="logoUrl" :labelCol="{ span: 3 }">
                <j-image-upload bizPath="scott/pic" v-model="form.logoUrl"></j-image-upload>
                <span>只能上传jpg/png格式文件,文件不能超过50kb</span>
              </a-form-model-item>
            </a-col>
            <a-col :span="24">
              <a-form-model-item label="集团介绍" prop="groupInfo" :labelCol="{ span: 3 }">
                <a-textarea
                  v-model="form.groupInfo"
                  placeholder="请输入"
                  :auto-size="{ minRows: 3, maxRows: 5 }"
                />
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-card>

        <a-card title="授权信息">
          <a-row>
            <a-col :span="24">
              <a-form-model-item label="授权日期" prop="empowerType" :labelCol="{ span: 3 }">
                <a-radio-group v-model="form.empowerType">
                  <a-radio value="1">永久</a-radio>
                  <a-radio value="2">授权日期</a-radio>
                </a-radio-group>
              </a-form-model-item>
            </a-col>
            <a-col :span="21" :offset="3" v-if="form.empowerType === '2'">
              <a-form-model-item label="" prop="empowerDate">
                <a-range-picker v-model="form.empowerDate" />
              </a-form-model-item>
            </a-col>
            <a-col :span="24">
              <a-form-model-item label="授权物业数量" prop="empowerPropertyNum" :labelCol="{ span: 3 }">
                <a-input-number id="inputNumber" v-model="form.empowerPropertyNum" :min="1" />
              </a-form-model-item>
            </a-col>
            <a-col :span="24">
              <a-form-model-item label="收费标准" prop="chargingStandardId" :labelCol="{ span: 3 }">
                <a-select style="width: 120px" v-model="form.chargingStandardId">
                  <a-select-option value="lucy">Lucy</a-select-option>
                </a-select>
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-card>

        <a-card title="合同附件">
          <a-row>
            <a-col :span="24">
              <a-form-model-item label="合同附件" prop="contractUrl" :labelCol="{ span: 3 }">
                <j-upload v-model="form.contractUrl"></j-upload>
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-card>
      </a-form-model>
    </a-modal>
  </a-card>
</template>

<script>
  import { getPropertyListApi, getSystemSubmenu, getSystemSubmenuBatch } from '@/api/api'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import PropertySettledModal from './modules/PropertySettledModal'
  import JEllipsis from '@/components/jeecg/JEllipsis'
  import JImageUpload from '@/components/jeecg/JImageUpload'
  import JUpload from '@/components/jeecg/JUpload'
  import {filterDictTextByCache} from '@/components/dict/JDictSelectUtil'

  const columns = [
    {
      title: '物业名称',
      dataIndex: 'propertyName',
      key: 'propertyName'
    },
    {
      title: '统一社会信用代码',
      dataIndex: 'creditCode',
      key: 'creditCode'
    },
    {
      title: '联系人',
      dataIndex: 'contactName',
      key: 'contactName'
    },
    {
      title: '电话',
      dataIndex: 'contactPhone',
      key: 'contactPhone'
    },
    {
      title: '授权时间',
      dataIndex: 'empowerDate',
      key: 'empowerDate'
    },
    {
      title: '授权物业数量',
      dataIndex: 'ontrialCommunityNum',
      key: 'ontrialCommunityNum'
    },
    {
      title: '审核状态',
      dataIndex: 'auditStatus',
      key: 'auditStatus',
      customRender: function(text) {
        return filterDictTextByCache('auditStatus', text);
      }
    },
    {
      title: '到期提示',
      dataIndex: 'ontrialEndDate',
      key: 'ontrialEndDate'
    },
    {
      title: '冻结/解冻',
      dataIndex: 'refuseDesc',
      key: 'refuseDesc'
    },
    {
      title: '操作',
      dataIndex: 'action',
      scopedSlots: { customRender: 'action' },
      align: 'center',
      width: 150
    }
  ]

  export default {
    name: 'PermissionListAsync',
    mixins: [JeecgListMixin],
    components: {
      PropertySettledModal,
      JEllipsis,
      JUpload,
      JImageUpload
    },
    data() {
      return {
        // 表头
        columns: columns,
        loading: false,
        pagination: {},
        url: {
          list: "/property/propertySettled/list",
          delete: '/sys/permission/delete',
          deleteBatch: '/sys/permission/deleteBatch'
        },

        modalTitle: '新增',
        visible: false,
        labelCol: { span: 6 },
        wrapperCol: { span: 14 },
        other: '',
        form: {
          propertyName: '',
          propertyCode: '',
          legalName: '',
          registCapital: undefined,
          contactName: '',
          contactPhone: '',
          registAdress: '',
          adressInfo: '',
          logoUrl: [],
          groupInfo: '',
          empowerType: '1',
          empowerDate: [],
          empowerPropertyNum: undefined,
          chargingStandardId: '',
          contractUrl: []
        },
        rules: {
          propertyName: [{ required: true, message: '请输入物业集团名称', trigger: 'blur' }],
          propertyCode: [{ required: true, message: '请输入统一信用代码', trigger: 'blur' }],
          legalName: [{ required: true, message: '请输入法人代表', trigger: 'blur' }],
          registCapital: [{ required: true, message: '请输入注册资本', trigger: 'blur' }],
          contactName: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
          contactPhone: [{ required: true, message: '请输入联系人电话', trigger: 'blur' }],
          registAdress: [{ required: true, message: '请选择注册地址', trigger: 'change' }],
          adressInfo: [{ required: true, message: '请输入详细地址', trigger: 'blur' }],
          logoUrl: [{ required: true, message: '请上传集团LOGO', trigger: 'change' }],
          empowerPropertyNum: [{ required: true, message: '请输入授权物业数量', trigger: 'blur' }],
          chargingStandardId: [{ required: true, message: '请选择收费标准', trigger: 'change' }],
          contractUrl: [{ required: true, message: '请上传合同附件', trigger: 'change' }]
        },
        uploadDisabled: false
      }
    },
    methods: {
      loadData() {
        this.loading = true
        getPropertyListApi({
          pageNo: 1,
          pageSize: 10
        }).then((res) => {
          if (res.success) {
            const pagination = { ...this.pagination };
            pagination.total = res.result.total
            this.dataSource = res.result.records
          }
        }).finally(()=>{
          this.loading = false
        })
      },
      onSubmit() {
        this.$refs.ruleForm.validate(valid => {
          if (valid) {
            alert('submit!');
          } else {
            console.log('error submit!!');
            return false;
          }
        });
      },
      close() {
        this.visible = false
      },
      handleSelectChange() {},
      handleSubmit() {},

      onSubmit() {
        this.$refs.ruleForm.validate(valid => {
          if (valid) {
            alert('submit!');
          } else {
            console.log('error submit!!');
            return false;
          }
        });
      },
      resetForm() {
        this.$refs.ruleForm.resetFields();
      },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>