index.vue 5.06 KB
<!--
 * @Description:
 * @Autor: renchao
 * @LastEditTime: 2023-09-14 17:19:26
-->
<template>
  <div class="slxx sdqxx">
    <el-form
      :model="ruleForm"
      ref="ruleForm"
      v-Loading="loading"
      :label-position="flag ? 'top' : ''"
      :inline="flag"
      label-width="130px">
      <div class="slxx_con" :class="flag ? 'formMarginBot0' : ''">
        <div class="slxx_title title-block">
          电力信息
          <div class="triangle"></div>
        </div>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="服务代码:">
              <el-input v-model="ruleForm.serviceCode"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="行政区划区县代码:">
              <el-input v-model="ruleForm.areacode"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="登记系统业务号:">
              <el-input v-model="ruleForm.ywh"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="推送日期:">
              <el-input v-model="ruleForm.SENDTIME"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="原户主姓名:">
              <el-input v-model="ruleForm.mcOld"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="原户主身份证号码:">
              <el-input v-model="ruleForm.zjhmOld"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="原户主联系电话:">
              <el-input v-model="ruleForm.lxdhOld"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="新户主姓名:">
              <el-input v-model="ruleForm.mcNew"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="新户主身份证号码:">
              <el-input v-model="ruleForm.zjhmNew"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="新户主联系电话:">
              <el-input v-model="ruleForm.lxdhNew"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="房产证编号:">
              <el-input v-model="ruleForm.fczbh"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="是否过户:">
              <el-switch
                v-model="ruleForm.sfgh"
                :active-value='1'
                active-text="是"
                :inactive-value="0"
                inactive-text="否">
              </el-switch>
            </el-form-item>
          </el-col>

        </el-row>
        <el-row :gutter="10">
          <el-col :span="24">
            <el-form-item label="房屋坐落(地址):">
              <el-input v-model="ruleForm.fwzl" type="textarea"
                :rows="2"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row class="btn" v-if="viewEdit">
          <el-form-item>
            <el-button type="primary" @click="onSubmit">保存</el-button>
          </el-form-item>
        </el-row>
      </div>
    </el-form>
  </div>
</template>
<script>
  import { mapGetters } from "vuex";
  import { getDlxxByBsmSldy, saveOrUpdateDlxx } from "@/api/sfxx.js";
  export default {
    computed: {
      ...mapGetters(["dictData", "flag"]),
    },
    mounted () {
      // this.loading = true
      this.viewEdit = this.$parent.currentSelectTab.ableOperation;
      this.propsParam = this.$attrs;
      var formdata = new FormData();
      formdata.append("bsmSldy", this.propsParam.bsmSldy);
      formdata.append("djlx", this.propsParam.djlx);
      formdata.append("isEdit", this.viewEdit);
      console.log(this.propsParam)
      this.getDlxxByBsmSldy()
    },
    data () {
      return {
        loading: false,
        //表单是否可操作
        viewEdit: false,
        ruleForm: {
          SFGH: 1
        }
      }
    },
    methods: {
      getDlxxByBsmSldy() {
        getDlxxByBsmSldy(this.propsParam.bsmSldy).then((res) => {
          if (res.code === 200) {
            if (res.result != null) {
              this.ruleForm = res.result
            }
          }
        });
      },
      saveOrUpdateDlxx() {
        saveOrUpdateDlxx(this.ruleForm).then((res) => {
          if (res.code === 200) {
           this.$message.success("成功")
          }
        });
      },
      onSubmit () {
        this.saveOrUpdateDlxx()
      }
    }
  }
</script>
<style scoped lang="scss">
  @import "~@/styles/public.scss";
  @import "~@/styles/slxx/slxx.scss";
</style>