zhaoxiaoqiang1
2026-01-04 f1d30d03186c79ca2cbcfe60d6d2ce7d73fba97b
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
<template>
  <div class="ownerList">
    <div class="list-content">
      <FormList
        :info="formInfo"
        :isShowDetail="false"
        @handleClick="isShowDetail = !isShowDetail"
        @updateValue="updateValue"
        :buttonsList="[1, 2]"
        @onSubmit="onSubmit"
        @setValueInfo="setValueInfo"
        :isChangeArray="false"
      ></FormList>
      <div class="tabContent" v-loading.fullscreen.lock="fullscreenLoading" element-loading-spinner="el-icon-loading"
    element-loading-background="rgba(0, 0, 0, 0.8)" element-loading-text="拼命加载中">
        <el-tabs v-model="activeName" @tab-click="handleClick" v-if="ownerlArr && ownerlArr.length >0" type="card">
          <el-tab-pane
            v-for="(item, index) in ownerlArr"
            :key="index"
            :label="item.projectStructureName.value"
            :name="index.toString()"
          >
            <el-form
              :model="ownerlForm[index]"
              ref="ownerlForm"
              label-width="165px"
              inline
              size="small"
            >
              <div class="_block">
                <p class="title">
                  <span></span>
                  物业明细信息
                </p>
                <div class="form">
                  <template v-for="(data, i) in ownerlKey[0]">
                    <el-form-item
                      :label="data.label"
                      v-if="
                        ownerlArr[index][data.field] &&
                        ownerlArr[index][data.field].visible
                      "
                      :prop="data.field"
                      :class="{ isLong: data.isLong }"
                    >
                      <span class="text-span">
                        {{ ownerlForm[index][data.field] }}
                      </span>
                    </el-form-item>
                  </template>
                </div>
              </div>
              <div class="_block">
                <p class="title">
                  <span></span>
                  产权人信息
                </p>
                <el-table
                  stripe
                  :data="ownerlForm[index].ownerInfoList"
                  style="margin-top: 30px"
                  class="owner-table"
                  highlight-current-row
                  :header-cell-style="{
                    background: '#f5f5f5',
                    color: '#222222',
                  }"
                >
                  <el-table-column prop="cstName" label="业主姓名">
                  </el-table-column>
                  <el-table-column prop="phoneNumber" label="业主手机号">
                  </el-table-column>
                  <el-table-column prop="certId" label="业主身份证号">
                  </el-table-column>
                  <el-table-column
                    width="420px"
                    prop="contactAddress"
                    label="联系地址"
                  >
                  </el-table-column>
                </el-table>
              </div>
              <div class="_block">
                <p class="title">
                  <span></span>
                  其他信息
                </p>
                <div class="form">
                  <template v-for="(data, i) in ownerlKey[1]">
                    <el-form-item
                      :label="data.label"
                      v-if="
                        ownerlArr[index][data.field] &&
                        ownerlArr[index][data.field].visible
                      "
                      :prop="data.field"
                      :class="{ isLong: data.isLong }"
                    >
                      <span class="text-span">
                        {{ ownerlForm[index][data.field] }}
                      </span>
                    </el-form-item>
                  </template>
                </div>
 
                <el-table
                  stripe
                  :data="ownerlForm[index].priceInfoList"
                  style="margin-top: 30px"
                  highlight-current-row
                  :header-cell-style="{
                    background: '#f5f5f5',
                    color: '#222222',
                  }"
                >
                  <el-table-column
                    min-width="100"
                    prop="priceTypeName"
                    label=""
                  >
                  </el-table-column>
                  <el-table-column min-width="200" prop="amount" label="应收">
                    <template slot-scope="scope">
                      {{ formatMoney(scope.row.amount) }}
                    </template>
                  </el-table-column>
                  <el-table-column
                    min-width="200"
                    prop="actAmount"
                    label="已收"
                  >
                    <template slot-scope="scope">
                      {{ formatMoney(scope.row.actAmount) }}
                    </template></el-table-column
                  >
                  <el-table-column
                    min-width="200"
                    prop="uncAmount"
                    label="未收"
                  >
                    <template slot-scope="scope">
                      {{ formatMoney(scope.row.uncAmount) }}
                    </template></el-table-column
                  >
                  <el-table-column
                    min-width="200"
                    prop="planDate"
                    label="计划时间"
                  >
                  </el-table-column>
                </el-table>
              </div>
            </el-form>
          </el-tab-pane>
        </el-tabs>
      </div>
      <div v-if="ownerlArr && ownerlArr.length <1" class="nodata">
        请输入客户姓名和身份证号查询沃土信息
      </div>
    </div>
  </div>
</template>
<script>
/**
 * 贷款合同发送
 */
import FormList from "./components/FormList";
import { qryOwnerHouseDetail } from "@/api/product";
 
export default {
  components: {
    FormList,
  },
  data() {
    return {
      // 搜索表单字段及描述
      formInfo: [
        {
          type: "input",
          label: "客户姓名",
          value: "",
          name: "custName",
        },
        {
          type: "input",
          label: "身份证号",
          value: "",
          name: "certId",
        },
      ],
      initialArr: [], //初始数据
      // 表单结果数据
      fullscreenLoading:false,
      valueInfo: {},
      isShowDetail: false,
      isClick:0,
      activeName: "0",
      ownerlForm: [],
      ownerlArr: [],
      objectType: "ContractSendApply",
      // 是否显示所有表单项
      loading: '',
      ownerlKey: [
        [
          { field: "projectStructureName", label: "小区/项目名称" },
          { field: "houseAddress", label: "房产地址" },
          // { field: 'corporateName', label: '业主姓名' },
          // { field: 'corporateCertId', label: '业主手机号' },
          // { field: 'corporatePhone', label: '业主身份证号' },
        ],
        [
          { field: "loanName", label: "按揭银行名称" },
          { field: "predictLoanDate", label: "按揭发放时间", isDate: true },
          { field: "actDeliveryDate", label: "实际交房时间", isDate: true },
          { field: "rightHandleDate", label: "产权办证日期", isDate: true },
          { field: "consultantName", label: "置业顾问姓名" },
          { field: "tradeStatus", label: "状态" },
        ],
      ],
    };
  },
  created() {
  },
  methods: {
    // 页面初始化处理
    async init() {
      this.getList();
      const ownerlResult = await this.qryOwnerHouseDetail();
      console.log('ownerlResult',ownerlResult)
      this.loading.colse()
      this.getCollaterData(ownerlResult);
    },
    handleClick(tab) {
      this.activeName = tab.index.toString();
    },
    // 设置表单结果数据
    setValueInfo(info = {}) {
      this.valueInfo = info;
    },
 
    // 获取当前数据列表
    async getList() {
      const ownerlResult = await this.qryOwnerHouseDetail();
      this.fullscreenLoading = false
      console.log("ownerlResult", ownerlResult);
      this.getCollaterData(ownerlResult);
    },
    //查询核心企业信息
    qryOwnerHouseDetail() {
      return new Promise((resolve) => {
        qryOwnerHouseDetail({
          certId: this.valueInfo.certId || '',
          custName: this.valueInfo.custName || '',
        }).then((res) => {
          resolve(res.result);
        })
      });
    },
    // 更新数据
    updateValue(value, item) {
      let { name } = item;
      this.setOrGetFormInfo(name, { value });
    },
 
    async getCollaterData(result) {
      this.ownerlArr = [];
      this.ownerlForm = [];
      this.initialArr = [];
      this.ownerlArr.push(...result);
      console.log("result", this.ownerlArr);
      // 初始化数据和校验规则
      this.ownerlArr.forEach(async (item, index) => {
        const obj = {};
        const rule = {};
        item.obj = {};
        item.rule = {};
        for (const key in item) {
          // 格式化金额
          if (key == "ownerlAmt" || key == "valuation" || key == "evaluation") {
            item[key].value = this.formatMoney(item[key].value);
          }
          // 自定义校验规则,涉及金额将进行格式化
          item.rule[key] = [];
          for (const key in item) {
            if (key == "ownerInfoList" || key == "priceInfoList") {
              item.obj[key] = item[key];
            } else if (typeof item[key] == "object") {
              item.obj[key] = item[key].value;
            }
          }
        }
      });
      this.ownerlArr.forEach((res) => {
        this.ownerlForm.push(res.obj);
        this.initialArr.push(Object.assign({}, res.obj));
      });
    },
     // 金额格式化
    formatMoney(value) {
      if (value) {
        value =
          parseFloat((value + "").replace(/[^\d\.-]/g, "")).toFixed(2) + "";
        if (value == "NaN") return;
        let l = value.split(".")[0].split("").reverse();
        let r = value.split(".")[1];
        let t = "";
        for (let i = 0; i < l.length; i++) {
          t += l[i] + ((i + 1) % 3 === 0 && i + 1 !== l.length ? "," : "");
        }
        return t.split("").reverse().join("") + "." + r;
      }
    },
    // 更新表单数据或查找某项数据
    setOrGetFormInfo(nameKey, newInfo) {
      let { formInfo } = this;
      let index = formInfo.findIndex(({ name }) => name === nameKey);
      let result = {};
      if (!isNaN(index)) {
        this.$set(this.formInfo, index, { ...formInfo[index], ...newInfo });
        result = this.formInfo[index];
      }
      if (typeof newInfo === "undefined") {
        return result;
      }
    },
    // 查询操作
    onSubmit() {
      if(this.valueInfo.certId && this.valueInfo.certId){
        this.fullscreenLoading = true;
        this.isClick = this.isClic
        this.getList();
        return
      }else{
        this.ownerlForm = []
        this.ownerlArr = []
      }
    },
  },
};
</script>
<style lang="postcss" scoped>
.list-content {
  font-size: 14px;
}
.export-excle {
  margin: 20px 0;
}
.ownerList {
 
  & >>>  .form {
    width: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: start;
    -ms-flex-pack: start;
    justify-content: flex-start;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}
  & >>> .el-form{
    width: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: start;
    -ms-flex-pack: start;
    justify-content: flex-start;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
   }
 
  
   & >>>  .form .el-form-item .el-form-item__label {
    line-height: 16px;
  }
  & >>>  .form .el-form-item .el-form-item__content {
    /* width: 100%; */
      line-height: 22px;
      vertical-align: middle;
}
 
   & >>> ._block {
      width: 100%;
      margin: 0
  }
 
  & >>> .el-form-item {
    align-items: center;
    display: flex;
    width: 33.33%;
    margin: 0 0 24px 0;
    padding-right: 60px;
    box-sizing:border-box ;
  }
  & >>> .el-table {
 
    padding-right: 40px;
  }
 
 
  & >>> .title {
 
    margin: 30px 0 20px 0;
    padding: 0 0 0 10px;
    border-left: solid 2px #0081F0;
    line-height: 16px;
    font-size: 14px;
    color: #222222;
  }
 
  & >>> .btn,  & >>> .fixedBtn {
    display: none;
  }
 
  & >>> .el-input.is-disabled .el-input__inner {
    border: none;
    background: none;
  }
}
.nodata{
  text-align: center;
  padding-top: 150px;
  border-top: 1px solid #eee;
  color: #827f7f;
}
</style>