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
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
<template>
  <div class="dataBack" v-loading="loading">
    <el-form :label-position="labelPosition" :model="form" ref="form" v-show="!loading" id="enter-form">
      <el-row>
        <p class="title">基本信息</p>
        <!-- 项目编号 -->
        <el-col :md="12" :lg="8" v-if="config.productnumber.visible">
          <area-input :config="config.productnumber" v-model="form.productnumber"></area-input>
        </el-col>
        <!-- 项目名称 -->
        <el-col :md="12" :lg="8" v-if="config.productname.visible">
          <area-input :config="config.productname" v-model="form.productname"></area-input>
        </el-col>
        <!-- 项目类型 -->
        <el-col :md="12" :lg="8" v-if="config.projectFrom.visible">
          <area-select key="1" :config="config.projectFrom" v-model="form.projectFrom"></area-select>
        </el-col>
        <!-- 开发商名称 -->
        <el-col :md="12" :lg="8" v-if="config.developer.visible">
          <area-input :config="config.developer" v-model="form.developer"></area-input>
        </el-col>
        <!-- 任意客户名称 -->
        <el-col :md="12" :lg="8" v-if="config.arbCustomerName.visible && form.projectFrom == '1'">
          <area-input :config="config.arbCustomerName" v-model="form.arbCustomerName"></area-input>
        </el-col>
        <!-- 任意客户身份证号码 -->
        <el-col :md="12" :lg="8" v-if="config.arbCustomerCertId.visible && form.projectFrom == '1'">
          <area-input :config="config.arbCustomerCertId" v-model="form.arbCustomerCertId"></area-input>
        </el-col>
        <!-- 集团项目编码 -->
        <el-col :md="12" :lg="8" v-if="config.groupProjectNo.visible && form.projectFrom == '1'">
          <!-- <area-select :config="config.groupProjectNo" v-model="form.groupProjectNo"></area-select> -->
          <el-form-item :label="config.groupProjectNo.filedDescription" :prop="config.groupProjectNo.name" :rules="{
            required: config.groupProjectNo.required,
            message: '请输入' + config.groupProjectNo.filedDescription,
            trigger: 'change'
          }">
            <el-select allow-create    filterable placeholder="请选择" v-model="form.groupProjectNo"
              @change="changegroupProjectName"
              :disabled="!config.groupProjectNo.writeAble">
              <el-option v-for="item in groupProjectNoOptopns" :key="item.projectStructureId"
                :label="item.projectStructureId" :value="item.projectStructureId" :disabled="item.disabled">
                <span style="float: left">{{ item.projectStructureName }}</span>
              </el-option>
            </el-select>
            <el-button icon="el-icon-search" style="position: absolute;height: 31px;width: 32px;top: 5px;right: -30px;padding: 0;" @click="getGroupList()"></el-button>
          </el-form-item>
        </el-col>
        <!-- 集团项目名称 -->
        <el-col :md="12" :lg="8" v-if="config.groupProjectName && config.groupProjectName.visible">
          <area-input :config="config.groupProjectName" v-model="form.groupProjectName"></area-input>
         </el-col>
          <!-- 项目地址(省) -->
        <el-col :md="12" :lg="8" v-if="config.registerprovince.visible">
          <el-form-item label="项目地址(省)" prop="registerprovince" :rules="{
            required: config.registerprovince.required,
            message: '请输入项目地址(省)',
            trigger: 'change'
          }">
            <el-select
              v-model="form.registerprovince"
              filterable
              clearable
              placeholder="请选择"
              :disabled="!config.registerprovince.writeAble"
            >
              <el-option
                v-for="item in registerprovinceOptions"
                :key="item.itemno"
                :label="item.itemname"
                :value="item.itemno"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <!-- 项目地址(市) -->
        <el-col :md="12" :lg="8" v-if="config.registercitys.visible">
          <el-form-item label="项目地址(市)" prop="registercitys" :rules="{
            required: config.registercitys.required,
            message: '请输入项目地址(市)',
            trigger: 'change'
          }">
            <el-select
              v-model="form.registercitys"
              filterable
              placeholder="请选择"
              clearable
              :disabled="!config.registercitys.writeAble"
            >
              <el-option
                v-for="item in registercitysOptions"
                :key="item.itemno"
                :label="item.itemname"
                :value="item.itemno"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <!-- 项目地址(区/县) -->
        <el-col :md="12" :lg="8" v-if="config.registercounty.visible">
          <el-form-item label="项目地址(区/县)" prop="registercounty"  :rules="{
            required: config.registercitys.registercounty,
            message: '请输入项目地址(区/县)',
            trigger: 'change'
          }">
            <el-select
              v-model="form.registercounty"
              filterable
              placeholder="请选择"
              clearable
              :disabled="!config.registercounty.writeAble"
            >
              <el-option
                v-for="item in registercountyOptions"
                :key="item.itemno"
                :label="item.itemname"
                :value="item.itemno"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :md="12" :lg="8" v-if="config.issuingcertdate && config.issuingcertdate.visible">
          <area-date :config="config.issuingcertdate" v-model="form.issuingcertdate"></area-date>
         </el-col>
         <el-col :md="12" :lg="8" v-if="config.projectdiscountdays && config.projectdiscountdays.visible">
          <area-input inputType="number" :config="config.projectdiscountdays" v-model="form.projectdiscountdays"></area-input>
         </el-col>
         <el-col :md="12" :lg="8" v-if="config.discountmonthamt.visible">
          <area-input inputType="number" :config="config.discountmonthamt" v-model="form.discountmonthamt"></area-input>
         </el-col>
      </el-row>
      <!-- 集团项目编码 -->
        <!-- <el-col :md="12" :lg="8" v-if="config.arbCustomerName.visible">
          <area-input :config="config.arbCustomerName" v-model="form.arbCustomerName"></area-input>
        </el-col> -->
      <el-row>
        <p class="title">项目银行卡信息(<b style="color:#f00">车位贷必填</b>)</p>
         <!-- 项目编号 -->
        <el-col :md="12" :lg="8">
          <area-input :config="config.putoutbankname" v-model="form.putoutbankname"></area-input>
        </el-col>
         <el-col :md="12" :lg="8"  v-if="config.putoutbankno.visible">
          <area-select  key="2" configKey="BankCode" :configValueDesc="config.putoutbankno.value"  @input="changebank" :config="config.putoutbankno" v-model="form.putoutbankno"></area-select>
        </el-col>
         <el-col :md="12" :lg="8">
          <area-input :config="config.putoutcardno" v-model="form.putoutcardno"></area-input>
        </el-col>
        <el-col :md="12" :lg="8">
          <el-form-item
            :label="config.putoutbankbranchnname.filedDescription"
            :prop="config.putoutbankbranchnname.name"
          >
            <el-autocomplete
                  style="width:100%"
                  v-model="form.putoutbankbranchnname" 
                  clearable 
                  :fetch-suggestions="querySearchAsync"
                  :trigger-on-focus="false"
                  :popper-append-to-body="false"
                  :debounce='300'
                  value-key="label"
                  placeholder="请输入名称进行选择"
                  @select="handleSelect"
                  @clear="blurForBug()"
                  ref="myAutocomplete"
                ></el-autocomplete>
          </el-form-item>
        </el-col>
        <el-col :md="12" :lg="8">
          <area-input :config="config.putoutbankbranchno" v-model="form.putoutbankbranchno"></area-input>
        </el-col>
      </el-row>
 
      <el-row v-if="config.needGuarantee.visible">
        <p class="title">担保信息</p>
 
        <!-- 担保信息 -->
        <el-col :md="12" :lg="8" v-if="config.needGuarantee.visible">
          <area-select key="3" :config="config.needGuarantee" v-model="form.needGuarantee"></area-select>
        </el-col>
      </el-row>
 
      <el-row>
        <p class="title">客群白名单信息</p>
        <WhiteCustomer :config="config" type="add" specialtype="02"></WhiteCustomer>
      </el-row>
 
      <el-row>
        <p class="title">客户白名单信息</p>
        <WhiteCustomer :config="config" type="add" specialtype="03"></WhiteCustomer>
      </el-row>
 
      <el-row>
        <p class="title">项目联系人信息</p>
        <ProjectContract pagetype="add"></ProjectContract>
      </el-row>
    </el-form>
  </div>
</template>
 
<script>
import {
  qryProjectInfo,
  updateProjectInfo,
  getProvinceCodeList,
  getCityCodeList,
  getAreaCodeList,
  qryGroupProjectList,
  qryBankBranchList
} from '@/api/area'
import { mapState } from 'vuex'
import AreaSelect from '../../components/AreaSelect'
import AreaDate from '../../components/AreaDate'
import AreaInput from '../../components/AreaInput'
import AreaInputNum from '../../components/AreaInputNum'
import AreaText from '../../components/AreaText'
import WhiteCustomer from './components/WhiteCustomer'
import ProjectContract from './components/ProjectContract'
import ProjectQualityInfo from './ProjectQualityInfo'
 
export default {
  components: { ProjectQualityInfo, AreaDate, AreaSelect, AreaInput, AreaInputNum, AreaText, WhiteCustomer, ProjectContract },
  props: ['nextChange'],
  data: function () {
    return {
      loading: false,
      labelPosition: 'right',
      writeAble: false,
      rules: {
        required: true,
        message: '请选择',
        trigger: 'change'
      },
      form: {
        putoutbankname:'',   //收款银行户名
        putoutbankno:'',   //收款银行开户行
        putoutcardno:'',   // 收款银行账号
        putoutbankbranchno:'',//收款银行开户行支行编号 
        putoutbankbranchnname:'',//收款银行开户行支行名称 
        needGuarantee: '',
        developer: '',
        projectdiscountdays:'',
        discountmonthamt:'',
        arbCustomerName: '',
        arbCustomerCertId: '',
        groupProjectNo: '',
        productnumber: '',
        projecttype: '',
        productname: '',
        projectcode: '',
        producttype: '',
        urbanlevel: '',
        productlevel: '',
        productstage: '',
        salesstage: '',
        belongingorganization: '',
        productpa: '',
        registerprovince: '',
        registercitys: '',
        registercounty: '',
        productaddress: '',
        productstreet: '',
        customerlocation: '',
        remarka: '',
        gpslongitude: '',
        gpslatitude: '',
        productsize: '',
        totalperiod: '',
        totalnumber: '',
        salesperiod: '',
        nowsalesnumber: '',
        nowsalesnumberperiod: '',
        buildingscale: '',
        landarea: '',
        totalplanearea: '',
        property: '',
        propertyyear: '',
        properynumbers: '',
        properylayers: '',
        villa: '',
        properyother: '',
        buildingarea: '',
        building1: '',
        buildingnumbers1: '',
        building2: '',
        buildingnumbers2: '',
        building3: '',
        buildingnumbers3: '',
        servicestarttime: '',
        saleintotime: '',
        latestopendate: '', // 最近一次开盘时间
        theatretime: '',
        buildingtime: '',
        projectFrom: '',
        businessPart: '',
        monthQuota: '',
        houseprovetime: '',
        // 项目素质字段迁移
        salescontract: '', // 销售合同
        salepermit: '', // 预售证
        salepermitnumber: '', // 预售证号
        firstsetfirstpay: '', // 首套首付比例(%)
        twosetfirstpay: '', // 二套首付比例(%)
        degradationrate: '', // 去化率
        sectionbuilding: '', // 地段
        locationaround: '', // 周边资源配套完善性
        cloudloan: '', // 贷款推广策略
        // 定价合理性
        singlesumpricetop: '', // 项目单套总价上限(万)
        singlesumpricelower: '', // 项目单套总价下限(万)
        aveprice: '', // 本盘均价(元/㎡)
        pricebetweenup: '', // 价格区间上限(元/㎡)
        pricebetweendown: '', // 价格区间下限(元/㎡)
        pricecompare: '', // 周边同档同类均价比较
        projectone: '', // 同档同类项目名1
        projectoneprice: '' ,// 同档同类项目名1均价(元/㎡),
        issuingcertdate:'',
        projectStructureName:'',
        groupProjectName:'',
      },
      oldForm: {},
      config: {},
      groupProjectNoOptopns: [],
      // 省市区
      registerprovinceOptions: [],
      registercitysOptions: [],
      registercountyOptions: []
    }
  },
  computed: {
    ...mapState({
      detailsParams: state => state.risk.detailsParams
    }),
    propertyMessages() {
      const {
        property,
        propertyyear,
        properynumbers,
        properylayers,
        villa,
        properyother,
        buildingarea,
        building1,
        buildingnumbers1,
        building2,
        buildingnumbers2,
        building3,
        buildingnumbers3
      } = this.config
      if (
        property.visible &&
        propertyyear.visible &&
        properynumbers.visible &&
        properylayers.visible &&
        villa.visible &&
        properyother.visible &&
        buildingarea.visible &&
        building1.visible &&
        buildingnumbers1.visible &&
        building2.visible &&
        buildingnumbers2.visible &&
        building3.visible &&
        buildingnumbers3.visible
      ) {
        return true
      } else {
        return false
      }
    }
  },
   created() {
    this.getForm()
    this.getProvinceCodeList()
    // this.qryOwnerGroupInfoList()
  },
  watch: {
    // 省市区联动
    'form.registerprovince': function (value, oldValue) {
      if (value) {
        this.getCityCodeList(value)
      }
      if (value !== oldValue && oldValue) {
        this.form.registercitys = ''
      }
      // getCityCodeList(params).then(res => {
      //   this.registercitysOptions = res.result
      // })
      // this.form.registercitys = ''
      // this.form.registercounty = ''
    },
    'form.registercitys': function (value, oldValue) {
      if (value) {
        this.getAreaCodeList(value)
      }
      if (value !== oldValue && oldValue) {
        this.form.registercounty = ''
      }
      // let params = {
      //   codeNo: 'AreaCode',
      //   itmeNo: val
      // }
      // getAreaCodeList(params).then(res => {
      //   this.registercountyOptions = res.result
      // })
      // this.form.registercounty = ''
    }
  },
  methods: {
    changebank(){
      this.form.putoutbankbranchnname = ''
      this.form.putoutbankbranchno = ''
    },
    changeValue(val, name) {
      this.form[`${name}`] = val
    },
     // 点击clearable清空小图标按钮以后,继续重新在输入框中输入数据,querySearch会触发,但是cb函数不会触发
    // 这样的话就会出现发请求了,也获取数据了,但是input框的输入建议下拉框不呈现在页面上的问题,所以解决方法就是
    // 只要用户点击了
    blurForBug(){
      document.activeElement.blur()
    },
    async querySearchAsync(query, cb) {
      console.log(this.form.putoutbankbranchno )
      if(query.length>1){
        this.form.putoutbankbranchno = ''
        const { result } = await qryBankBranchList({ 
          currentPage:1,
          pageSize:10,
          bankcode:this.form.putoutbankno,
          bankname:query
        })
        result.records.forEach(val => {
          val.label = `${val.bankname}`
          val.value = `${val.bankno}`
        });
          cb(result.records);
      }else{
        cb([]);
      }
    },
    handleSelect(data) {
      this.form.putoutbankbranchno = data.bankno;
      this.form.putoutbankbranchnname = data.bankname;
    },
    changegroupProjectName(e) {
      if (this.groupProjectNoOptopns) {
        let obj = null
        this.groupProjectNoOptopns.map(res => {
          if (e === res.projectStructureId) {
            obj = res
          }
        })
        if (obj) {
          this.form.groupProjectName = obj.projectStructureName
          this.form.registerprovince = obj.registerprovince
          this.form.registercounty = obj.registercounty
          this.form.registercitys = obj.registercitys
        }
      }
    },
    async getGroupList() {
      let obj = {
        certId: this.form.arbCustomerCertId,
        cstName: this.form.arbCustomerName,
      }
 
      let { result } = await qryGroupProjectList(obj)
      this.groupProjectNoOptopns = result
      if (result.length > 0) {
        this.form.groupProjectNo = result[0].projectStructureId
        this.form.groupProjectName = result[0].projectStructureName
        this.form.registerprovince = result[0].registerprovince
        this.form.registercounty = result[0].registercounty
        this.form.registercitys = result[0].registercitys
      }
    },
    async getForm() {
      this.loading = true
      // 初始化表单
      this.config = Object.assign({}, this.config, this.form)
      Object.keys(this.config).forEach(key => {
        let params = {
          visible: false,
          required: false,
          writeAble: false
        }
        this.$set(this.config, key, params)
      })
      let params = {
        objectType: this.detailsParams.objectType,
        dataType: this.detailsParams.dataType,
        projectFlag: this.detailsParams.projectFlag,
        projectType: this.detailsParams.projectType,
        serialno: this.detailsParams.objectNo
      }
      await qryProjectInfo(params).then(res => {
        this.config = this._.merge(this.config, res.result)
        Object.keys(this.form).forEach(key => {
          if(key == 'needGuarantee' && this.config[key].value == '') {
            this.$set(this.form, key, '1')
          } else 
          this.$set(this.form, key, this.config[key].value)
        })
        console.log(' this.config', this.config)
        Object.assign(this.oldForm, this.form)
        // console.log(this.oldForm)
        // console.log(this.form)
        this.loading = false
      })
    },
    getProvinceCodeList() {
      // 查询省
      getProvinceCodeList({}).then(res => {
        this.registerprovinceOptions = res.result
      })
    },
    getCityCodeList(value) {
      let params = {
        codeNo: 'AreaCode',
        itmeNo: value
      }
      getCityCodeList(params).then(res => {
        this.registercitysOptions = res.result
      })
    },
    getAreaCodeList(value) {
      let params = {
        codeNo: 'AreaCode',
        itmeNo: value
      }
      getAreaCodeList(params).then(res => {
        this.registercountyOptions = res.result
      })
    },
    submitForm() {
      this.$refs['form'].validate(valid => {
        if (valid) {
          let params = {
            serialno: this.detailsParams.objectNo,
            objecttype: this.detailsParams.objectType,
            dataType: this.detailsParams.dataType,
            isTempSave: false
          }
          if(this.form.discountmonthamt){
            this.form.discountmonthamt = Number(this.form.discountmonthamt)
          }
          if(this.form.projectdiscountdays){
            this.form.projectdiscountdays = Number(this.form.projectdiscountdays)
          }
          Object.assign(params, this.form)
          updateProjectInfo(params).then(res => {
            if (res.code === '00') {
              // this.$message.success(res.result.resultsDesc)
              this.$emit('handleNextPage', true)
            }
          })
        } else {
          this.$message.warning(
            '当前页面存在必填项未录入或数据录入错误,请检查!'
          )
          return false
        }
      })
    },
    // 保存草稿
    handleSaveDraft() {
      let params = {
        serialno: this.detailsParams.objectNo,
        objecttype: this.detailsParams.objectType,
        dataType: this.detailsParams.dataType,
        isTempSave: true
      }
      Object.assign(params, this.form)
      updateProjectInfo(params).then(res => {
        if (res.code === '00') {
          this.$message.success('保存成功')
          this.oldForm = Object.assign(this.oldForm, this.form)
        }
      })
    },
    // 保存
    handleSave() {
      this.$refs['form'].validate(valid => {
        if (valid) {
          let params = {
            serialno: this.detailsParams.objectNo,
            objecttype: this.detailsParams.objectType,
            dataType: this.detailsParams.dataType,
            isTempSave: true
          }
          Object.assign(params, this.form)
          updateProjectInfo(params).then(res => {
            if (res.code === '00') {
              this.$message.success('保存成功')
              this.oldForm = Object.assign(this.oldForm, this.form)
            }
          })
        } else {
          // this.$message.warning('当前页面存在必填项未录入或数据录入错误,请检查!')
          this.$message.warning(
            '当前页面存在必填项未录入或数据录入错误,请检查!'
          )
          return false
        }
      })
    }
  },
  beforeRouteLeave(to, from, next) {
    // console.log(this.form)
    // console.log(this.oldForm)
    // console.log(this.nextChange)
    if (this.nextChange) {
      for (const key in this.oldForm) {
        if (this.oldForm.hasOwnProperty(key)) {
          if (this.oldForm[key] != this.form[key]) {
            this.$confirm(`当前页面有未保存的数据,是否放弃保存`, '提示', {
              confirmButtonText: '是',
              cancelButtonText: '否',
              customClass: 'pro_messages_box',
              confirmButtonClass: 'pro_messages_box_confirm',
              cancelButtonClass: 'pro_messages_box_cancel',
              center: true
            })
              .then(() => {
                next()
              })
              .catch(() => {
                this.$emit('notNext')
              })
            return
          }
        }
      }
    }
    next()
  }
}
</script>
 
<style scoped>
 
</style>