qlfFwFdcqDzXm.vue 7.52 KB
<template>
  <div class="multiplehouseInfoXmsx itemForm">
    <el-form :model="ruleForm" ref="formList" label-width="115px" :key="key">
      <div v-for="(item, index) in ruleForm.itemList" :key="index" class="multiplehouseInfoXmsx-item">
        <p class="multiplehouseInfoXmsx-item-name">项目属性{{ index + 1 }}</p>
        <div class="multiplehouseInfoXmsx-item-list">
          <el-row>
            <el-col :span="16">
              <el-form-item :prop="'itemList.' + index + '.XMMC'" :rules="rules.XMMC">
                <span slot="label">
                  项目名称: <br />
                  <p class="label-detail">(XMMC)</p>
                </span>
                <el-input :disabled="$store.state.business.Edit" v-model="ruleForm.itemList[index].XMMC"
                  placeholder="项目名称"></el-input>
              </el-form-item>
            </el-col>

            <el-col :span="8">
              <el-form-item :prop="'itemList.' + index + '.BDCDYH'" :rules="rules.BDCDYH">
                <span slot="label">
                  不动产单元号: <br />
                  <p class="label-detail">(BDCDYH)</p>
                </span>
                <el-input :disabled="$store.state.business.Edit" v-model="ruleForm.itemList[index].BDCDYH"
                  placeholder="不动产单元号"></el-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="8">
              <el-form-item :prop="'itemList.' + index + '.ZH'" :rules="rules.ZH">
                <span slot="label">
                  幢号: <br />
                  <p class="label-detail">(ZH)</p>
                </span>
                <el-input :disabled="$store.state.business.Edit" v-model="ruleForm.itemList[index].ZH"
                  placeholder="幢号"></el-input>
              </el-form-item>
            </el-col>

            <el-col :span="8">
              <el-form-item :prop="'itemList.' + index + '.ZCS'" :rules="{ ...rules.ZCS, ...typeNum }">
                <span slot="label">
                  总层数: <br />
                  <p class="label-detail">(ZCS)</p>
                </span>
                <el-input :disabled="$store.state.business.Edit" v-model.number="ruleForm.itemList[index].ZCS"
                  type="number" v-only-number="{ max: 9999, min: 0, precision: 0 }" placeholder="总层数"></el-input>
              </el-form-item>
            </el-col>

            <el-col :span="8">
              <el-form-item :prop="'itemList.' + index + '.GHYT'" :rules="rules.GHYT">
                <span slot="label">
                  规划用途: <br />
                  <p class="label-detail">(GHYT)</p>
                </span>
                <el-input :disabled="$store.state.business.Edit" v-model="ruleForm.itemList[index].GHYT"
                  placeholder="规划用途"></el-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="8">
              <el-form-item :prop="'itemList.' + index + '.FWJG'" :rules="rules.FWJG">
                <span slot="label">
                  房屋结构: <br />
                  <p class="label-detail">(FWJG)</p>
                </span>
                <el-input :disabled="$store.state.business.Edit" v-model="ruleForm.itemList[index].FWJG"
                  placeholder="房屋结构"></el-input>
              </el-form-item>
            </el-col>

            <el-col :span="8">
              <el-form-item :prop="'itemList.' + index + '.JZMJ'" :rules="{ ...rules.JZMJ, ...typeNum }">
                <span slot="label">
                  建筑面积:<br />
                  <p class="label-detail">(JZMJ)</p>
                </span>
                <el-input :disabled="$store.state.business.Edit" v-model.number="ruleForm.itemList[index].JZMJ"
                  type="number" v-only-number="{ max: 999999999999999, min: 0, precision: 2 }"
                  placeholder="建筑面积"></el-input>
              </el-form-item>
            </el-col>

            <el-col :span="8">
              <el-form-item :prop="'itemList.' + index + '.JGSJ'" :rules="rules.JGSJ">
                <span slot="label">
                  竣工时间: <br />
                  <p class="label-detail">(JGSJ)</p>
                </span>
                <el-date-picker :disabled="$store.state.business.Edit" type="date" placeholder="选择日期" clearable
                  v-model="ruleForm.itemList[index].JGSJ" value-format="yyyy-MM-dd"></el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="8">
              <el-form-item :prop="'itemList.' + index + '.ZTS'" :rules="{ ...rules.ZTS, ...typeNum }">
                <span slot="label">
                  总套数: <br />
                  <p class="label-detail">(ZTS)</p>
                </span>
                <el-input :disabled="$store.state.business.Edit" v-model.number="ruleForm.itemList[index].ZTS"
                  v-only-number="{ max: 9999, min: 0, precision: 0 }" placeholder="总套数"></el-input>
              </el-form-item>
            </el-col>

            <el-col :span="8">
              <el-form-item :prop="'itemList.' + index + '.QXDM'" :rules="rules.QXDM">
                <span slot="label">
                  区县代码: <br />
                  <p class="label-detail">(QXDM)</p>
                </span>
                <el-input :disabled="$store.state.business.Edit" v-model="ruleForm.itemList[index].QXDM"
                  placeholder="区县代码"></el-input>
              </el-form-item>
            </el-col>

          </el-row>
        </div>
      </div>
    </el-form>
    <message-tips ref="msg" />
  </div>
</template>
<script>
// 房地产权(项目内多幢房屋)项目属性
import qlfFwFdcqDzXm from '@/api/qlfFwFdcqDzXm'
import ruleMixin from '@/mixins/ruleMixin.js'
export default {
  mixins: [ruleMixin],
  props: {
    bsmSjsb: {
      type: String,
      default: ''
    },
    bsmYwsjb: {
      type: String,
      default: ''
    }
  },
  data () {
    return {
      ruleForm: {
        itemList: [
          {
            XMMC: '',
            BDCDYH: '',
            ZH: '',
            ZCS: '',
            GHYT: '',
            FWJG: '',
            JZMJ: '',
            JGSJ: '',
            ZTS: '',
            QXDM: ''
          }
        ]
      }
    }
  },
  methods: {
    async featchData () {
      try {
        let { result: res } = await qlfFwFdcqDzXm.getQlfFwFdcqDzXmById(this.bsmSjsb)
        this.ruleForm.itemList = res
        //this.featchRule()
      } catch (error) {
        this.$refs.msg.messageShow()
      }
    },
    handleUpdateForm () {
      return new Promise(async (resolve, reject) => {
        try {
          let res = await qlfFwFdcqDzXm.updateQlfFwFdcqDzXm(this.ruleForm.itemList)
          // this.$refs['formList'].resetFields();
          resolve(res.code)
        } catch (error) {
          this.$refs.msg.messageShow()
        }
      })
    }
  }
}
</script>
<style scoped lang="scss">
@import "./css/itemForm.scss";

.multiplehouseInfoXmsx-item {
  display: flex;
  height: 100%;
  margin-bottom: 15px;
  margin-right: 5px;

  &-name {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    padding: 10px 20px;
    line-height: 28px;
    border: 1px solid #ccc;
    margin-right: 15px;
    border-radius: 3px;
  }

  &-list {
    width: 100%;
    flex: 1;
    display: flex;
    justify-content: center;
    flex-direction: column;
  }
}
</style>