Blame view

src/views/workflow/components/fdcqxmTable.vue 6.52 KB
1 2 3
<!--
 * @Description: 房屋多幢明细
 * @Autor:
4
 * @LastEditTime: 2023-09-01 13:29:29
5 6 7 8 9 10 11 12 13 14 15 16
-->
<template>
  <div>
    <el-table
      :data="tableDataList"
      border
      :pagination="false"
      :key="key"
      :header-cell-style="{ 'text-align': 'center' }"
      :heightNumSetting="true"
      :minHeight="150"
      height="150"
17
      style="width: 100%">
18 19
      <el-table-column prop="index" width="50" :render-header="renderHeader">
        <template slot-scope="scope">
20
          <div style="text-align: center">{{ scope.$index + 1 }}</div>
21 22 23 24
        </template>
      </el-table-column>
      <el-table-column prop="bdcdyh" label="不动产单元号" min-width="100">
        <template slot-scope="scope">
25
          <div style="text-align: center">{{ scope.row.bdcdyh }}</div>
26 27 28 29
        </template>
      </el-table-column>
      <el-table-column prop="xmmc" label="项目名称" min-width="100">
        <template slot-scope="scope">
30 31 32 33 34
          <el-input
            class="item"
            :disabled="!ableOperation"
            v-model="scope.row.xmmc"
            placeholder="请输入内容"
35
            @input="updaterow(scope.row)">
36
          </el-input>
37 38
        </template>
      </el-table-column>
单帅旗 committed
39 40 41 42 43 44 45 46 47 48 49 50
      <el-table-column prop="fwxz" label="房屋性质" min-width="100">
        <template slot-scope="scope">
          <treeselect
            v-model="scope.row.fwxz"
            :disabled="!ableOperation"
            noOptionsText="暂无数据"
            placeholder=""
            :show-count="true"
            :options="dictData['A19']"
            :normalizer="normalizer"
            :appendToBody="true"
            z-index="9999"
51
            @input="updaterow(scope.row)" />
单帅旗 committed
52 53
        </template>
      </el-table-column>
54
      <el-table-column prop="ghyt" label="房屋用途" min-width="100">
55
        <template slot-scope="scope">
56 57 58 59 60 61 62 63 64 65
          <treeselect
            v-model="scope.row.ghyt"
            :disabled="!ableOperation"
            noOptionsText="暂无数据"
            placeholder=""
            :show-count="true"
            :options="dictData['A17']"
            :normalizer="normalizer"
            :appendToBody="true"
            z-index="9999"
66
            @input="updaterow(scope.row)" />
67 68
        </template>
      </el-table-column>
69
      <el-table-column prop="fwjg" label="房屋结构" min-width="100">
70
        <template slot-scope="scope">
71 72 73 74 75 76 77 78 79 80
          <treeselect
            v-model="scope.row.fwjg"
            :disabled="!ableOperation"
            noOptionsText="暂无数据"
            placeholder=""
            :show-count="true"
            :options="dictData['A46']"
            :normalizer="normalizer"
            :appendToBody="true"
            z-index="9999"
81
            @input="updaterow(scope.row)" />
82 83
        </template>
      </el-table-column>
84
      <el-table-column prop="jzmj" label="建筑面积" min-width="100">
85
        <template slot-scope="scope">
86
          <el-input
xiaomiao committed
87
            maxlength="12"
88 89 90 91 92
            class="item"
            :disabled="!ableOperation"
            oninput="value = (value.match(/^\d*(\.?\d{0,2})/g)[0]) || null"
            v-model="scope.row.jzmj"
            placeholder="请输入内容"
93
            @input="updaterow(scope.row)">
94
          </el-input>
95 96
        </template>
      </el-table-column>
97
      <el-table-column prop="jgsj" label="竣工时间" min-width="100">
98
        <template slot-scope="scope">
99 100 101 102 103 104 105
          <el-date-picker
            v-model="scope.row.jgsj"
            type="date"
            :disabled="!ableOperation"
            placeholder="选择日期"
            value-format="yyyy-MM-dd HH:mm:ss"
            format="yyyy-MM-dd"
106
            @input="updaterow(scope.row)">
107
          </el-date-picker>
108 109
        </template>
      </el-table-column>
110
      <el-table-column prop="zcs" label="总层数" min-width="100">
111
        <template slot-scope="scope">
112 113 114 115 116 117
          <el-input
            class="item"
            :disabled="!ableOperation"
            oninput="value = (value.match(/^\d*(\.?\d{0,2})/g)[0]) || null"
            v-model="scope.row.zcs"
            placeholder="请输入内容"
118
            @input="updaterow(scope.row)">
119
          </el-input>
120 121
        </template>
      </el-table-column>
122
      <el-table-column prop="zts" label="总套数" min-width="100">
123
        <template slot-scope="scope">
124 125 126 127 128 129
          <el-input
            class="item"
            :disabled="!ableOperation"
            oninput="value = (value.match(/^\d*(\.?\d{0,2})/g)[0]) || null"
            v-model="scope.row.zts"
            placeholder="请输入内容"
130
            @input="updaterow(scope.row)">
131
          </el-input>
132 133 134 135 136 137
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
138
  import { mapGetters } from "vuex";
139

140 141 142
  export default {
    computed: {
      ...mapGetters(["dictData"]),
143
    },
144 145 146 147 148 149
    props: {
      tableData: {
        type: Array,
        default: function () {
          return [];
        },
150
      },
151 152 153
      ableOperation: {
        type: Boolean,
        default: false,
154
      },
155

156
    },
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
    data () {
      return {
        // 键名转换,方法默认是label和children进行树状渲染
        key: 0,
        tableDataList: [],
        normalizer (node) {
          if (node.children == null || node.children == "null") {
            delete node.children;
          }
          return {
            id: node.dcode,
            label: node.dname,
            children: node.children,
          };
        },
      };
    },
    mounted () {
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
    watch: {
      tableData: {
        handler: function (val, oldVal) {
          let that = this;
          this.$nextTick(() => {
            if (val.length == 0 || !val) {
              that.tableDataList = _.cloneDeep([
                {
                  yt: null,
                  qssj: "",
                  jssj: "",
                  tdsyqx: "",
                },
              ]);
            } else {
              that.tableDataList = _.cloneDeep(val);
            }
          });
        },
        immediate: true,
        deep: true,
      },
    },
    methods: {
      /**
       * @description: renderHeader
       * @author: renchao
       */
      renderHeader () {
        return (
          <div>
            {"序号"}
          </div>
        );
      },
      updaterow (a) {
        this.$emit("updateFdcwxmList", this.tableDataList);
      }
214
    }
215
  }
216 217
</script>
<style scoped lang="scss">
218 219 220
  .el-input {
    border: none !important;
  }
221

222 223 224
  /deep/ .el-table__row {
    border: none !important;
  }
225

226 227 228
  .el-date-editor.el-input {
    width: 100%;
  }
229

230 231 232
  /deep/ .el-table th {
    height: 30px !important;
  }
233 234
</style>