<!--
|
* @Author: your name
|
* @Date: 2019-10-21 15:40:58
|
* @LastEditTime: 2019-11-22 15:14:21
|
* @LastEditors: Please set LastEditors
|
* @Description: In User Settings Edit
|
* @FilePath: \cts-web\src\views\area\projectManagement\add\ProjectProtection.vue
|
-->
|
<template>
|
<el-container class="dataBack" v-loading="loading">
|
<el-main v-show="!loading" style="padding:0px">
|
<el-form :label-position="labelPosition" :model="form" ref="form">
|
<el-row>
|
<p class="title">基本信息</p>
|
<!-- 自营-代理形式 社会化-销售方 -->
|
<el-col :md="12" :lg="8" v-if="config.deputizetype.visible">
|
<area-select :config="config.deputizetype" v-model="form.deputizetype"></area-select>
|
</el-col>
|
<el-col :md="12" :lg="8" v-if="config.proxyform.visible">
|
<area-select :config="config.proxyform" v-model="form.proxyform"></area-select>
|
</el-col>
|
<!-- 项目经理 -->
|
<el-col :md="12" :lg="8" v-if="config.productlead.visible">
|
<area-input :config="config.productlead" v-model="form.productlead"></area-input>
|
</el-col>
|
<!-- 代理公司全国排名-->
|
<el-col :md="12" :lg="8" v-if="config.deputizecountryrank.visible">
|
<area-select-dis
|
:config="config.deputizecountryrank"
|
v-model="form.deputizecountryrank"
|
></area-select-dis>
|
</el-col>
|
<!-- 代理公司当地排名 -->
|
<el-col :md="12" :lg="8" v-if="config.deputizelocalrank.visible">
|
<area-select :config="config.deputizelocalrank" v-model="form.deputizelocalrank"></area-select>
|
</el-col>
|
<!-- 有无我方项目负责人 -->
|
<el-col :md="12" :lg="8" v-if="config.nospecificperson.visible">
|
<area-select :config="config.nospecificperson" v-model="form.nospecificperson"></area-select>
|
</el-col>
|
<!-- 团队本地化能力 -->
|
<el-col :md="12" :lg="8" v-if="config.teamlocal.visible">
|
<area-select :config="config.teamlocal" v-model="form.teamlocal"></area-select>
|
</el-col>
|
<!-- 是否有我司员工驻点 -->
|
<el-col :md="12" :lg="8" v-if="config.arrestPointFlag.visible">
|
<area-select :config="config.arrestPointFlag" v-model="form.arrestPointFlag"></area-select>
|
</el-col>
|
<!-- 购房真实性核实办法 -->
|
<el-col :md="12" :lg="8" v-if="config.truthCheckMethod.visible">
|
<area-select :config="config.truthCheckMethod" v-model="form.truthCheckMethod"></area-select>
|
</el-col>
|
<!-- 购房真实性核实办法说明 -->
|
<el-col :lg="24" v-if="config.truthCheckMethodRmk.visible">
|
<area-text :config="config.truthCheckMethodRmk" v-model="form.truthCheckMethodRmk"></area-text>
|
</el-col>
|
|
<!-- <el-col :md="12" :lg="8" v-if="config.serviceline.visible"> -->
|
<el-col :md="12" :lg="8" v-if="false">
|
<area-select :config="config.serviceline" v-model="form.serviceline"></area-select>
|
</el-col>
|
<!-- <el-col :md="12" :lg="8" v-if="config.salenature.visible"> -->
|
<el-col :md="12" :lg="8" v-if="false">
|
<area-select :config="config.salenature" v-model="form.salenature"></area-select>
|
</el-col>
|
<!-- <el-col :md="12" :lg="8" v-if="config.theatreproperties.visible"> -->
|
<el-col :md="12" :lg="8" v-if="false">
|
<area-select :config="config.theatreproperties" v-model="form.theatreproperties"></area-select>
|
</el-col>
|
|
<!-- 主要负责人 -->
|
|
<!-- 项目代理类型 -->
|
<!-- <el-col :md="12" :lg="8" v-if="config.producttype.visible"> -->
|
<el-col :md="12" :lg="8" v-if="false">
|
<area-select :config="config.producttype" v-model="form.producttype"></area-select>
|
</el-col>
|
|
<!-- 项目经理 -->
|
<!-- <productlead-select :config="config.productlead" v-model="form.productlead"></productlead-select> -->
|
<!-- 主策负责人 -->
|
<!-- <productlead-select :config="config.mainpolicy" v-model="form.mainpolicy"></productlead-select> -->
|
<!-- <el-col :md="12" :lg="8" v-if="config.mainpolicy.visible"> -->
|
<el-col :md="12" :lg="8" v-if="false">
|
<area-input :config="config.mainpolicy" v-model="form.mainpolicy"></area-input>
|
</el-col>
|
<!-- <el-col :md="12" :lg="8" v-if="config.proxyapproachtime.visible"> -->
|
<el-col :md="12" :lg="8" v-if="false">
|
<area-date
|
:config="config.proxyapproachtime"
|
v-model="form.proxyapproachtime"
|
:remove="removeTime"
|
></area-date>
|
</el-col>
|
<!-- <el-col :md="12" :lg="8" v-if="config.managerapproachtime.visible"> -->
|
<el-col :md="12" :lg="8" v-if="false">
|
<area-date
|
:config="config.managerapproachtime"
|
v-model="form.managerapproachtime"
|
:remove="removeTime"
|
></area-date>
|
</el-col>
|
<!-- <el-col :md="12" :lg="8" v-if="config.managerage.visible"> -->
|
<el-col :md="12" :lg="8" v-if="false">
|
<area-input :config="config.managerage" v-model="form.managerage"></area-input>
|
</el-col>
|
<!-- <el-col :md="12" :lg="8" v-if="config.shilianproxysale.visible"> -->
|
<el-col :md="12" :lg="8" v-if="false">
|
<area-input :config="config.shilianproxysale" v-model="form.shilianproxysale"></area-input>
|
</el-col>
|
</el-row>
|
|
<el-row>
|
<p class="title" v-if="record">对账管理</p>
|
<!-- 有无开发商财务对接人 -->
|
<el-col :md="12" :lg="8" v-if="config.isfinance.visible">
|
<area-select :config="config.isfinance" v-model="form.isfinance"></area-select>
|
</el-col>
|
<!-- 开发商财务对接人姓名 -->
|
<el-col :md="12" :lg="8" v-if="config.developfinancename.visible">
|
<area-input :config="config.developfinancename" v-model="form.developfinancename"></area-input>
|
</el-col>
|
<!-- 开发商财务联系方式 -->
|
<el-col :md="12" :lg="8" v-if="config.developfinancephone.visible">
|
<area-input :config="config.developfinancephone" v-model="form.developfinancephone"></area-input>
|
</el-col>
|
<!-- 对账机制 -->
|
<!-- 暂时屏蔽该字段 -->
|
<!-- <el-col :md="12" :lg="8" v-if="config.accountnumber.visible">
|
<area-select :config="config.accountnumber" v-model="form.accountnumber"></area-select>
|
</el-col>-->
|
<el-col :md="12" :lg="8" v-if="config.accountmechanism.visible">
|
<area-product-select
|
:config="config.accountmechanism"
|
v-model="form.accountmechanism"
|
:projectType="detailsParams.projectType"
|
:producttype="form.producttype"
|
></area-product-select>
|
</el-col>
|
<!-- 对账机制情况说明 -->
|
<el-col :lg="24" v-if="config.otherbalanceremark.visible">
|
<area-text :config="config.otherbalanceremark" v-model="form.otherbalanceremark"></area-text>
|
</el-col>
|
|
<!-- <el-col :md="12" :lg="8" v-if="config.accountnumber.visible"> -->
|
<el-col :md="12" :lg="8" v-if="false">
|
<area-select :config="config.accountnumber" v-model="form.accountnumber"></area-select>
|
</el-col>
|
<!-- <el-col :md="12" :lg="8" v-if="config.tradingagencies.visible"> -->
|
<el-col :md="12" :lg="8" v-if="false">
|
<area-select :config="config.tradingagencies" v-model="form.tradingagencies"></area-select>
|
</el-col>
|
|
<!-- <el-col :md="12" :lg="8" v-if="config.acctloan.visible"> -->
|
<el-col :md="12" :lg="8" v-if="false">
|
<area-select :config="config.acctloan" v-model="form.acctloan"></area-select>
|
</el-col>
|
<!-- 对账结果系统录入责任人 -->
|
<!-- {{form.erpsystemintoman}} -->
|
<!-- <el-col :md="12" :lg="8" v-if="config.erpsystemintoman.visible"> -->
|
<el-col :md="12" :lg="8" v-if="false">
|
<area-input :config="config.erpsystemintoman" v-model="form.erpsystemintoman"></area-input>
|
</el-col>
|
|
<!-- <el-col :md="12" :lg="8" v-if="config.tradingagencies.visible">
|
<area-select :config="config.tradingagencies" v-model="form.tradingagencies"></area-select>
|
</el-col>-->
|
<!-- <el-col :md="12" :lg="8" v-if="config.developfinancework.visible"> -->
|
<el-col :md="12" :lg="8" v-if="false">
|
<area-input :config="config.developfinancework" v-model="form.developfinancework"></area-input>
|
</el-col>
|
<!-- <el-col :md="12" :lg="8" v-if="config.shilianaccountpeople.visible"> -->
|
<el-col :md="12" :lg="8" v-if="false">
|
<area-input :config="config.shilianaccountpeople" v-model="form.shilianaccountpeople"></area-input>
|
</el-col>
|
</el-row>
|
|
<el-row v-if="detailsParams.projectType == '2' || detailsParams.projectType === '社会化'">
|
<p class="title">项目拓展人信息</p>
|
<!-- 项目拓展人信息表格 -->
|
<ProjectDevInfoTable @proDevInfo="proDevInfo"></ProjectDevInfoTable>
|
</el-row>
|
|
<el-row v-if="detailsParams.projectType == '2' || detailsParams.projectType === '社会化' ">
|
<!-- <el-row > -->
|
<p class="title">驻点员工信息</p>
|
<!-- 驻点员工信息表格 -->
|
<StaffInformationTable :isRequireTable="isRequireTable" @staffArr="staffArr"></StaffInformationTable>
|
</el-row>
|
|
<el-row>
|
<p class="title">项目人员信息</p>
|
<project-protection-table></project-protection-table>
|
</el-row>
|
|
<el-row v-if="false">
|
<p class="title" v-if="customerManagement">非鹏友代理客户管理(联带开放项目/营销顾问/社会化项目,同时有我方报单专员和我方项目负责人)</p>
|
|
<el-col :md="12" :lg="8" v-if="config.specifiedpolicy.visible">
|
<area-input :config="config.specifiedpolicy" v-model="form.specifiedpolicy"></area-input>
|
</el-col>
|
<el-col :md="12" :lg="8" v-if="config.joba.visible">
|
<area-input :config="config.joba" v-model="form.joba"></area-input>
|
</el-col>
|
<el-col :md="12" :lg="8" v-if="config.singlepersonmanage.visible">
|
<area-input :config="config.singlepersonmanage" v-model="form.singlepersonmanage"></area-input>
|
</el-col>
|
<el-col :md="12" :lg="8" v-if="config.jobb.visible">
|
<area-input :config="config.jobb" v-model="form.jobb"></area-input>
|
</el-col>
|
<el-col :md="12" :lg="8" v-if="config.cloudloanratio.visible">
|
<area-input :config="config.cloudloanratio" v-model="form.cloudloanratio"></area-input>
|
</el-col>
|
</el-row>
|
|
<!-- <el-row v-if="detailsParams.projectType ==='2' && deputizetype "> -->
|
<el-row v-if="false">
|
<p class="title">代理商资质及能力</p>
|
<!-- 备案代理公司名称 -->
|
<el-col :md="12" :lg="8" v-if="config.salecomapnyname.visible">
|
<area-input :config="config.salecomapnyname" v-model="form.salecomapnyname"></area-input>
|
</el-col>
|
<!-- 代理公司家数 -->
|
<el-col :md="12" :lg="8" v-if="config.salecomapnynmuber.visible">
|
<area-input :config="config.salecomapnynmuber" v-model="form.salecomapnynmuber"></area-input>
|
</el-col>
|
|
<!-- 代理公司资质 -->
|
<el-col :md="12" :lg="8" v-if="config.complianceaptitude.visible">
|
<area-select :config="config.complianceaptitude" v-model="form.complianceaptitude"></area-select>
|
</el-col>
|
<!-- 代理公司执业时间 -->
|
<el-col :md="12" :lg="8" v-if="config.employmenttime.visible">
|
<area-select :config="config.employmenttime" v-model="form.employmenttime"></area-select>
|
</el-col>
|
<!-- 是否有两个角色驻场 -->
|
<el-col :md="12" :lg="8" v-if="config.istworolefield.visible">
|
<area-select :config="config.istworolefield" v-model="form.istworolefield"></area-select>
|
</el-col>
|
<!-- 管理方案 -->
|
<el-col :md="12" :lg="8" v-if="config.manageschemes.visible">
|
<area-input :config="config.manageschemes" v-model="form.manageschemes"></area-input>
|
</el-col>
|
<!-- 专人报单 -->
|
<el-col :md="12" :lg="8" v-if="config.specialpolicy.visible">
|
<area-input :config="config.specialpolicy" v-model="form.specialpolicy"></area-input>
|
</el-col>
|
<!-- 项目经理 -->
|
<el-col :md="12" :lg="8" v-if="config.projectmanage.visible">
|
<area-input :config="config.projectmanage" v-model="form.projectmanage"></area-input>
|
</el-col>
|
<!-- 运营 -->
|
<el-col :md="12" :lg="8" v-if="config.motion.visible">
|
<area-input :config="config.motion" v-model="form.motion"></area-input>
|
</el-col>
|
</el-row>
|
|
<el-row v-if="false">
|
<p class="title" v-if="projectSale">项目约束与折扣</p>
|
<el-col :md="12" :lg="8" v-if="config.signfirsttime.visible">
|
<area-select :config="config.signfirsttime" v-model="form.signfirsttime"></area-select>
|
</el-col>
|
<el-col :md="12" :lg="8" v-if="config.allfirstterm.visible">
|
<area-input :config="config.allfirstterm" v-model="form.allfirstterm"></area-input>
|
</el-col>
|
<el-col :md="12" :lg="8" v-if="config.delaysign.visible">
|
<area-select :config="config.delaysign" v-model="form.delaysign"></area-select>
|
</el-col>
|
<el-col :md="12" :lg="8" v-if="config.firstlongdelay.visible">
|
<area-input :config="config.firstlongdelay" v-model="form.firstlongdelay"></area-input>
|
</el-col>
|
<el-col :md="12" :lg="8" v-if="config.signtimerebate.visible">
|
<area-input :config="config.signtimerebate" v-model="form.signtimerebate"></area-input>
|
</el-col>
|
<el-col :md="12" :lg="8" v-if="config.wagesloanrebate.visible">
|
<area-input :config="config.wagesloanrebate" v-model="form.wagesloanrebate"></area-input>
|
</el-col>
|
<el-col :md="12" :lg="8" v-if="config.businessloanrebate.visible">
|
<area-input :config="config.businessloanrebate" v-model="form.businessloanrebate"></area-input>
|
</el-col>
|
<el-col :md="12" :lg="8" v-if="config.grouploanrebate.visible">
|
<area-input :config="config.grouploanrebate" v-model="form.grouploanrebate"></area-input>
|
</el-col>
|
<el-col :md="12" :lg="8" v-if="config.disposableloanrebate.visible">
|
<area-input :config="config.disposableloanrebate" v-model="form.disposableloanrebate"></area-input>
|
</el-col>
|
<el-col :md="12" :lg="8" v-if="config.otherloanrebate.visible">
|
<area-input :config="config.otherloanrebate" v-model="form.otherloanrebate"></area-input>
|
</el-col>
|
</el-row>
|
</el-form>
|
</el-main>
|
</el-container>
|
</template>
|
|
<script>
|
import { queryProjectProtection, updateProjectProtection } from '@/api/area'
|
import { mapState } from 'vuex'
|
import AreaText from '../../components/AreaText'
|
import AreaDate from '../../components/AreaDate'
|
import AreaInput from '../../components/AreaInput'
|
import AreaSelect from '../../components/AreaSelect'
|
import AreaSelectDis from '../../components/AreaSelectDis'
|
import AreaProductSelect from '../../components/AreaProductSelect'
|
import ProjectProtectionTable from './components/ProjectProtectionTable'
|
import ProductleadSelect from './components/ProductleadSelect'
|
|
// Table
|
import ProjectDevInfoTable from './table/ProjectDevInfoTable'
|
import StaffInformationTable from './table/StaffInformationTable'
|
export default {
|
components: {
|
StaffInformationTable,
|
ProjectDevInfoTable,
|
AreaText,
|
ProductleadSelect,
|
ProjectProtectionTable,
|
AreaSelect,
|
AreaProductSelect,
|
AreaInput,
|
AreaDate,
|
AreaSelectDis
|
},
|
props: ['nextChange'],
|
data: function() {
|
return {
|
removeTime: true, // 去除时间
|
deputizetype: true,
|
labelPosition: 'right',
|
loading: true,
|
form: {
|
// 基本信息
|
deputizetype: '', // 自营-代理形式 社会化-销售方
|
productlead: '', // 项目经理
|
deputizecountryrank: '', // 代理公司全国排名
|
deputizelocalrank: '', // 代理公司当地排名
|
nospecificperson: '', // 有无我方项目负责人
|
teamlocal: '', // 团队本地化能力
|
arrestPointFlag: '', // 是否有我司员工驻点
|
truthCheckMethod: '', // 购房真实性核实办法
|
truthCheckMethodRmk: '', // 购房真实性核实办法说明
|
// 对账管理
|
isfinance: '', // 有无开发商财务对接人
|
developfinancename: '', // 开发商财务对接人姓名
|
developfinancephone: '', // 开发商财务联系方式
|
accountmechanism: '', // 对账机制
|
otherbalanceremark: '', // 对账机制情况说明
|
accountnumber: '',
|
mainpolicy: '',
|
serviceline: '',
|
salenature: '',
|
theatreproperties: '',
|
proxyform: '',
|
producttype: '',
|
proxyapproachtime: '',
|
managerapproachtime: '',
|
managerage: '',
|
shilianproxysale: '',
|
specifiedpolicy: '',
|
joba: '',
|
singlepersonmanage: '',
|
jobb: '',
|
cloudloanratio: '',
|
salecomapnyname: '',
|
salecomapnynmuber: '',
|
complianceaptitude: '',
|
employmenttime: '',
|
istworolefield: '',
|
manageschemes: '',
|
specialpolicy: '',
|
projectmanage: '',
|
motion: '',
|
signfirsttime: '',
|
allfirstterm: '',
|
delaysign: '',
|
firstlongdelay: '',
|
signtimerebate: '',
|
wagesloanrebate: '',
|
businessloanrebate: '',
|
grouploanrebate: '',
|
disposableloanrebate: '',
|
otherloanrebate: '',
|
posnumber: '',
|
posbank: '',
|
loannumber: '',
|
loanoperator: '',
|
loanseal: '',
|
acctloan: '',
|
erpsystemintoman: '',
|
tradingagencies: '',
|
developfinancework: '',
|
shilianaccountpeople: ''
|
},
|
oldForm: {},
|
options: [
|
{
|
value: '01',
|
valueDesc: '按天更新'
|
},
|
{
|
value: '02',
|
valueDesc: '按周更新'
|
},
|
{
|
value: '03',
|
valueDesc: '按月更新'
|
},
|
{
|
value: '04',
|
valueDesc: '到开发商结算才更新'
|
},
|
{
|
value: '05',
|
valueDesc: '有书面承诺或已签署云贷协议'
|
},
|
{
|
value: '06',
|
valueDesc: '无承诺且未签云贷协议'
|
}
|
],
|
config: {},
|
isRequireTable: false,
|
childArr: [],
|
devInfoArr: []
|
}
|
},
|
computed: {
|
...mapState({
|
detailsParams: state => state.risk.detailsParams,
|
projectType: state => state.risk.projectType
|
}),
|
// 客户管理
|
customerManagement() {
|
if (
|
this.config.nospecificperson.visible ||
|
this.config.specifiedpolicy.visible ||
|
this.config.joba.visible ||
|
this.config.singlepersonmanage.visible ||
|
this.config.jobb.visible ||
|
this.config.cloudloanratio.visible
|
) {
|
return true
|
} else {
|
return false
|
}
|
},
|
// 项目约束与折扣
|
projectSale() {
|
if (
|
this.config.signfirsttime.visible ||
|
this.config.allfirstterm.visible ||
|
this.config.delaysign.visible ||
|
this.config.firstlongdelay.visible ||
|
this.config.signtimerebate.visible ||
|
this.config.wagesloanrebate.visible ||
|
this.config.businessloanrebate.visible ||
|
this.config.grouploanrebate.visible ||
|
this.config.disposableloanrebate.visible ||
|
this.config.otherloanrebate.visible
|
) {
|
return true
|
} else {
|
return false
|
}
|
},
|
// 对账管理
|
record() {
|
if (
|
this.config.accountmechanism.visible ||
|
this.config.accountnumber.visible ||
|
this.config.acctloan.visible ||
|
this.config.erpsystemintoman.visible ||
|
this.config.otherbalanceremark.visible ||
|
this.config.tradingagencies.visible ||
|
this.config.isfinance.visible ||
|
this.config.developfinancework.visible ||
|
this.config.developfinancename.visible ||
|
this.config.developfinancephone.visible ||
|
this.config.shilianaccountpeople.visible
|
) {
|
return true
|
} else {
|
return false
|
}
|
}
|
},
|
watch: {
|
// 购房真实性核实办法
|
'form.truthCheckMethod': function(newVal) {
|
this.config.truthCheckMethodRmk.required = Boolean(newVal === '03')
|
},
|
// 是否有我司员工驻点
|
'form.arrestPointFlag': function(newVal) {
|
this.isRequireTable = Boolean(newVal == '1')
|
},
|
// 代理形式
|
'form.deputizetype': function(newVal, oldVal) {
|
if (this.projectType === '社会化') {
|
// 备案代理公司名称
|
this.config.salecomapnyname.required = Boolean(
|
newVal === '02' || newVal === '03' || newVal === '04'
|
)
|
this.config.salecomapnyname.visible = Boolean(
|
newVal === '02' || newVal === '03' || newVal === '04'
|
)
|
this.config.salecomapnyname.writeAble = Boolean(
|
newVal === '02' || newVal === '03' || newVal === '04'
|
)
|
if (newVal === '01' || newVal === '') {
|
// if (newVal !== oldVal) {
|
// console.log(2222)
|
this.form.salecomapnyname = ''
|
// }
|
}
|
// 代理公司家数
|
this.config.salecomapnynmuber.required = Boolean(
|
newVal === '02' || newVal === '03' || newVal === '04'
|
)
|
this.config.salecomapnynmuber.visible = Boolean(
|
newVal === '02' || newVal === '03' || newVal === '04'
|
)
|
this.config.salecomapnynmuber.writeAble = Boolean(
|
newVal === '02' || newVal === '03' || newVal === '04'
|
)
|
if (newVal === '01' || newVal === '') {
|
// if (newVal !== oldVal) {
|
this.form.salecomapnynmuber = ''
|
// }
|
}
|
// 代理公司全国排名
|
this.config.deputizecountryrank.required = Boolean(newVal !== '01')
|
this.config.deputizecountryrank.visible = Boolean(newVal !== '01')
|
this.config.deputizecountryrank.writeAble = Boolean(newVal !== '01')
|
if (!this.config.deputizecountryrank.visible) {
|
this.form.deputizecountryrank = ''
|
}
|
// 代理公司当地排名
|
this.config.deputizelocalrank.required = Boolean(newVal !== '01')
|
this.config.deputizelocalrank.visible = Boolean(newVal !== '01')
|
this.config.deputizelocalrank.writeAble = Boolean(newVal !== '01')
|
if (!this.config.deputizelocalrank.visible) {
|
this.form.deputizelocalrank = ''
|
}
|
// 代理公司资质
|
this.config.complianceaptitude.required = Boolean(newVal === '03')
|
this.config.complianceaptitude.visible = Boolean(newVal === '03')
|
this.config.complianceaptitude.writeAble = Boolean(newVal === '03')
|
if (!this.config.complianceaptitude.visible) {
|
this.form.complianceaptitude = ''
|
}
|
// 代理公司执业时间
|
this.config.employmenttime.required = Boolean(newVal === '03')
|
this.config.employmenttime.visible = Boolean(newVal === '03')
|
this.config.employmenttime.writeAble = Boolean(newVal === '03')
|
if (!this.config.employmenttime.visible) {
|
this.form.employmenttime = ''
|
}
|
// 是否有两个角色驻场
|
this.config.istworolefield.required = Boolean(newVal === '04')
|
this.config.istworolefield.visible = Boolean(newVal === '04')
|
this.config.istworolefield.writeAble = Boolean(newVal === '04')
|
if (!this.config.istworolefield.visible) {
|
// console.log(this.config.deputizelocalrank)
|
// console.log(this.form.deputizelocalrank)
|
this.form.istworolefield = ''
|
}
|
// 管理方案
|
this.config.manageschemes.required = Boolean(newVal === '04')
|
this.config.manageschemes.visible = Boolean(newVal === '04')
|
this.config.manageschemes.writeAble = Boolean(newVal === '04')
|
if (!this.config.manageschemes.visible) {
|
this.form.manageschemes = ''
|
}
|
// 专人报单
|
this.config.specialpolicy.required = Boolean(newVal === '04')
|
this.config.specialpolicy.visible = Boolean(newVal === '04')
|
this.config.specialpolicy.writeAble = Boolean(newVal === '04')
|
if (!this.config.specialpolicy.visible) {
|
this.form.specialpolicy = ''
|
}
|
// 项目经理
|
this.config.projectmanage.required = Boolean(newVal === '04')
|
this.config.projectmanage.visible = Boolean(newVal === '04')
|
this.config.projectmanage.writeAble = Boolean(newVal === '04')
|
if (!this.config.projectmanage.visible) {
|
this.form.projectmanage = ''
|
}
|
// 运营
|
this.config.motion.required = Boolean(newVal === '04')
|
this.config.motion.visible = Boolean(newVal === '04')
|
this.config.motion.writeAble = Boolean(newVal === '04')
|
if (!this.config.motion.visible) {
|
this.form.motion = ''
|
}
|
}
|
if (this.detailsParams.projectType === '2') {
|
if (newVal === '01' || newVal === '') {
|
this.deputizetype = false
|
} else {
|
this.deputizetype = true
|
}
|
}
|
},
|
// 有无开发商开发财务对接人
|
'form.isfinance': function(newVal) {
|
// console.log(this.projectType)
|
if (
|
this.projectType === '社会化' ||
|
this.detailsParams.projectType === '2'
|
) {
|
this.config.developfinancework.required = Boolean(newVal === '01')
|
this.config.developfinancework.visible = Boolean(newVal === '01')
|
this.config.developfinancework.writeAble = Boolean(newVal === '01')
|
if (!this.config.developfinancework.visible) {
|
this.form.developfinancework = ''
|
}
|
//
|
this.config.developfinancename.required = Boolean(newVal === '01')
|
this.config.developfinancename.visible = Boolean(newVal === '01')
|
// this.config.developfinancename.writeAble = Boolean(newVal === '01')
|
if (!this.config.developfinancename.visible) {
|
this.form.developfinancename = ''
|
}
|
//
|
this.config.developfinancephone.required = Boolean(newVal === '01')
|
this.config.developfinancephone.visible = Boolean(newVal === '01')
|
// this.config.developfinancephone.writeAble = Boolean(newVal === '01')
|
if (!this.config.developfinancephone.visible) {
|
this.form.developfinancephone = ''
|
}
|
//
|
this.config.shilianaccountpeople.required = Boolean(newVal === '01')
|
this.config.shilianaccountpeople.visible = Boolean(newVal === '01')
|
this.config.shilianaccountpeople.writeAble = Boolean(newVal === '01')
|
if (!this.config.shilianaccountpeople.visible) {
|
this.form.shilianaccountpeople = ''
|
}
|
//
|
this.config.accountnumber.required = Boolean(newVal === '01')
|
this.config.accountnumber.visible = Boolean(newVal === '01')
|
this.config.accountnumber.writeAble = Boolean(newVal === '01')
|
if (!this.config.accountnumber.visible) {
|
this.form.accountnumber = ''
|
}
|
}
|
},
|
// 项目代理类型
|
'form.producttype': function(newVal) {
|
// 01-独代
|
// 02-营销顾问
|
/*
|
projectType
|
1 - 自营
|
2 - 社会化
|
projectFlag
|
0 - 审批准入
|
1 - 项目立项
|
999 -老系统迁移
|
*/
|
const { projectType, projectFlag } = this.detailsParams
|
if (
|
projectType === '1' &&
|
(projectFlag === '0' || projectFlag === '999')
|
) {
|
// if (this.detailsParams.projectType === '1') {
|
if (newVal === '01') {
|
this.config.erpsystemintoman.required = true
|
this.config.erpsystemintoman.visible = true
|
// console.log(this.config.erpsystemintoman.visible)
|
} else {
|
this.config.erpsystemintoman.required = false
|
this.config.erpsystemintoman.visible = false
|
}
|
if (!this.config.erpsystemintoman.visible) {
|
this.form.erpsystemintoman = ''
|
}
|
}
|
// console.log(newVal)
|
}
|
},
|
created() {
|
this.initForm()
|
this.getForm()
|
},
|
methods: {
|
getForm() {
|
let params = {
|
objectType: this.detailsParams.objectType,
|
dataType: this.detailsParams.dataType,
|
projectFlag: this.detailsParams.projectFlag,
|
projectType: this.detailsParams.projectType,
|
serialno: this.detailsParams.objectNo
|
}
|
queryProjectProtection(params).then(res => {
|
this.config = this._.merge({}, this.config, res.result)
|
Object.keys(this.form).forEach(key => {
|
this.$set(this.form, key, this.config[key].value)
|
})
|
Object.assign(this.oldForm, this.form)
|
// console.log(this.config)
|
this.loading = false
|
})
|
},
|
initForm() {
|
Object.keys(this.form).forEach(key => {
|
let params = {
|
visible: false,
|
required: false,
|
writeAble: false
|
}
|
this.config[key] = Object.assign({}, this.config[key], params)
|
})
|
},
|
proDevInfo(arr) {
|
this.devInfoArr = [...arr]
|
},
|
staffArr(arr) {
|
this.childArr = [...arr]
|
},
|
submitForm() {
|
const { isRequireTable, childArr, devInfoArr } = this
|
this.$refs['form'].validate(valid => {
|
if (valid) {
|
let params = {
|
serialno: this.detailsParams.objectNo,
|
objecttype: this.detailsParams.objectType,
|
dataType: this.detailsParams.dataType,
|
isTempSave: false
|
}
|
Object.assign(params, this.form)
|
// 自营
|
if (this.detailsParams.projectType === '1') {
|
updateProjectProtection(params).then(res => {
|
if (res.code === '00') {
|
this.$emit('handleNextPage', true)
|
}
|
})
|
} else {
|
// 社会化
|
// 驻点员工为是 2个表格已填数据
|
if (isRequireTable && childArr.length > 0 && devInfoArr.length > 0) {
|
updateProjectProtection(params).then(res => {
|
if (res.code === '00') {
|
this.$emit('handleNextPage', true)
|
}
|
})
|
} else if (!isRequireTable && devInfoArr.length > 0) {
|
// 驻点员工为否 拓展人表格已填数据
|
updateProjectProtection(params).then(res => {
|
if (res.code === '00') {
|
this.$emit('handleNextPage', true)
|
}
|
})
|
} else if (
|
isRequireTable &&
|
devInfoArr.length === 0 &&
|
childArr.length > 0
|
) {
|
// 驻点员工为是 驻点员工表格已填数据 拓展人信息未填
|
this.$message.warning('项目拓展人信息未录入,请检查!')
|
} else if (
|
isRequireTable &&
|
devInfoArr.length > 0 &&
|
childArr.length === 0
|
) {
|
// 驻点员工为是 拓展人信息已填数据 驻点员工未填数据
|
this.$message.warning(
|
'是否有我司员工驻点为是时必须录入驻点员工信息,请检查!'
|
)
|
} else {
|
this.$message.warning('当前页面存在表单或表格数据未录入,请检查!')
|
}
|
}
|
} 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)
|
updateProjectProtection(params).then(res => {
|
if (res.code === '00') {
|
this.$message.success('保存成功')
|
this.oldForm = Object.assign(this.oldForm, this.form)
|
}
|
})
|
},
|
handleSave() {
|
const { isRequireTable, childArr, devInfoArr, detailsParams, projectType } = this
|
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)
|
// 社会化
|
if (projectType === '社会化' || detailsParams.projectType === '2') {
|
// 驻点员工为是 2个表格已填数据
|
if (isRequireTable && childArr.length > 0 && devInfoArr.length > 0) {
|
updateProjectProtection(params).then(res => {
|
if (res.code === '00') {
|
this.$message.success('保存成功')
|
this.oldForm = Object.assign(this.oldForm, this.form)
|
}
|
})
|
} else if (!isRequireTable && devInfoArr.length > 0) {
|
// 驻点员工为否 拓展人表格已填数据
|
updateProjectProtection(params).then(res => {
|
if (res.code === '00') {
|
this.$message.success('保存成功')
|
this.oldForm = Object.assign(this.oldForm, this.form)
|
}
|
})
|
} else if (
|
isRequireTable &&
|
devInfoArr.length === 0 &&
|
childArr.length > 0
|
) {
|
// 驻点员工为是 驻点员工表格已填数据 拓展人信息未填
|
this.$message.warning('项目拓展人信息未录入,请检查!')
|
} else if (
|
isRequireTable &&
|
devInfoArr.length > 0 &&
|
childArr.length === 0
|
) {
|
// 驻点员工为是 拓展人信息已填数据 驻点员工未填数据
|
this.$message.warning(
|
'是否有我司员工驻点为是时必须录入驻点员工信息,请检查!'
|
)
|
} else {
|
this.$message.warning('当前页面存在表单或表格数据未录入,请检查!')
|
}
|
} else {
|
// 自营
|
updateProjectProtection(params).then(res => {
|
if (res.code === '00') {
|
this.$message.success('保存成功')
|
this.oldForm = Object.assign(this.oldForm, this.form)
|
}
|
})
|
}
|
} else {
|
this.$message.warning(
|
'当前页面存在必填项未录入或数据录入错误,请检查!'
|
)
|
}
|
})
|
}
|
},
|
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]) {
|
// 空值和undefined不做比较
|
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>
|