20 changed files with 4359 additions and 3684 deletions
@ -0,0 +1,299 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div> |
|||
<div class="tab-header webtop"> |
|||
<div>现车库存</div> |
|||
<div> |
|||
<el-button type="primary" size="small" @click="handleConfirm()">确定</el-button> |
|||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
</div> |
|||
<div class=""> |
|||
<div class="searchcon"> |
|||
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button> |
|||
<div v-show="isSearchShow" class="search"> |
|||
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="130px" class="tab-header"> |
|||
<el-form-item label="品牌"> |
|||
<el-select v-model="listQuery.params.carbrand" class="addinputw" placeholder="请选择" @change="changeCarbrand"> |
|||
<el-option v-for="(item, index) in carbrand_list" :key="index.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="功能"> |
|||
<el-input v-model="listQuery.params.vehicleType" placeholder="请输入" clearable class="filter-item"/> |
|||
</el-form-item> |
|||
<el-form-item label="系列"> |
|||
<el-input v-model="listQuery.params.productLine" placeholder="请输入" clearable class="filter-item"/> |
|||
</el-form-item> |
|||
<el-form-item label="变速箱"> |
|||
<el-input v-model="listQuery.params.gearboxType" placeholder="请输入" clearable class="filter-item"/> |
|||
</el-form-item> |
|||
<el-form-item label="驱动"> |
|||
<el-input v-model="listQuery.params.driveForm" placeholder="请输入" clearable class="filter-item"/> |
|||
</el-form-item> |
|||
<el-form-item label="排放标准"> |
|||
<el-input v-model="listQuery.params.emissionStandard" placeholder="请输入" clearable class="filter-item"/> |
|||
</el-form-item> |
|||
<el-form-item label="马力"> |
|||
<el-input v-model="listQuery.params.power" placeholder="请输入" clearable class="filter-item"/> |
|||
</el-form-item> |
|||
<el-form-item label="燃料"> |
|||
<el-input v-model="listQuery.params.fuelType" placeholder="请输入" clearable class="filter-item"/> |
|||
</el-form-item> |
|||
<el-form-item label="版本"> |
|||
<el-input v-model="listQuery.params.vehicleVersion" placeholder="请输入" clearable class="filter-item"/> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="btn" style="text-align: center;"> |
|||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button> |
|||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="listtop"> |
|||
<div class="tit">现车库存列表</div> |
|||
<pageye v-show="total>0" :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> |
|||
</div> |
|||
<div class=""> |
|||
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%" @selection-change="handleSelectionChange"> |
|||
<el-table-column width="50px" type="selection" align="center"/> |
|||
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center"/> |
|||
<el-table-column label="品牌" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.brandName }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="车型" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.vehicleAlias }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="车架号" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.vinNo }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="颜色" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.carColor }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="存放地点" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.location }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="销售指导价(万元)" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.guidedPrice }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</div> |
|||
<div class="pages"> |
|||
<div class="tit"/> |
|||
<!-- 翻页 --> |
|||
<pagination v-show="total>0" :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from '@/components/pagination' |
|||
import pageye from '@/components/pagination/pageye' |
|||
import { getList } from '@/api/jichuxinxi/busdepositvehicle' |
|||
|
|||
export default { |
|||
name: "xuanzecheliang", |
|||
components: { |
|||
Pagination, |
|||
pageye |
|||
}, |
|||
data() { |
|||
return { |
|||
createPage: '', |
|||
dialogVisible: false, // 弹窗 |
|||
isSearchShow: false, |
|||
searchxianshitit: '显示查询条件', |
|||
btndisabled: false, |
|||
viewState: 1, // 1、列表 2、添加-车辆预定 3、编辑 4、查看 5、订金-定金收取 |
|||
// 查询 ----------- |
|||
carbrand_list: [], // 品牌 |
|||
tableKey: 0, |
|||
list: [], |
|||
sids: [], |
|||
total: 1, |
|||
FormLoading: false, |
|||
listLoading: false, |
|||
listQuery: { |
|||
current: 1, |
|||
size: 5, |
|||
params: { |
|||
carbrand: '', |
|||
driveForm: '', |
|||
emissionStandard: '', |
|||
fuelType: '', |
|||
gearboxType: '', |
|||
lockedState: '', |
|||
power: '', |
|||
productLine: '', |
|||
vehicleState: '', |
|||
vehicleType: '', |
|||
vehicleVersion: '' |
|||
} |
|||
}, |
|||
selectDate: undefined, |
|||
temp: {}, // 添加和编辑 |
|||
depositVehicleList: [], |
|||
visible: true, |
|||
hetongdanganguanliInfoShow: false |
|||
// ------------------------------------ |
|||
} |
|||
}, |
|||
methods: { |
|||
// 初始化 |
|||
init() { |
|||
this.handleFilter() |
|||
this.getcarbrand() |
|||
}, |
|||
// 搜索条件效果 |
|||
clicksearchShow() { |
|||
this.isSearchShow = !this.isSearchShow |
|||
if (this.isSearchShow) { |
|||
this.searchxianshitit = '隐藏查询条件' |
|||
} else { |
|||
this.searchxianshitit = '显示查询条件' |
|||
} |
|||
}, |
|||
// 重置 |
|||
handleReset() { |
|||
this.listQuery = { |
|||
current: 1, |
|||
size: 5, |
|||
params: { |
|||
carbrand: '', |
|||
driveForm: '', |
|||
emissionStandard: '', |
|||
fuelType: '', |
|||
gearboxType: '', |
|||
lockedState: '', |
|||
power: '', |
|||
productLine: '', |
|||
vehicleState: '', |
|||
vehicleType: '', |
|||
vehicleVersion: '' |
|||
} |
|||
} |
|||
}, |
|||
// 勾选 |
|||
handleSelectionChange(row) { |
|||
console.log('row', row) |
|||
this.depositVehicleList = row |
|||
const aa = [] |
|||
row.forEach((element) => { |
|||
aa.push(element.sid) |
|||
}) |
|||
this.sids = aa |
|||
console.log('选择sid', this.sids) |
|||
}, |
|||
// 品牌下拉 |
|||
getcarbrand() { |
|||
// selectBrand().then((res) => { |
|||
// if (res.code === '200') { |
|||
// this.carbrand_list = res.data |
|||
// console.log('下拉框请求品牌', res.data) |
|||
// } |
|||
// }) |
|||
}, |
|||
changeCarbrand(value) { |
|||
let bb = {} |
|||
this.carbrand_list.forEach((e) => { |
|||
// eslint-disable-next-line eqeqeq |
|||
if (e.dictKey == value) { |
|||
bb = { |
|||
name: e.dictValue, |
|||
key: e.dictKey, |
|||
sid: e.sid |
|||
} |
|||
} |
|||
}) |
|||
this.listQuery.params.carbrand = bb.name |
|||
console.log('name', this.listQuery.params.carbrand) |
|||
}, |
|||
// 确认 |
|||
handleConfirm() { |
|||
if (this.sids.length > 0) { |
|||
this.$emit('handleVehicle', this.depositVehicleList) |
|||
} else { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '没有选择车辆!', |
|||
type: 'error', |
|||
duration: 2000 |
|||
}) |
|||
return |
|||
} |
|||
}, |
|||
// 返回 |
|||
handleReturn() { |
|||
this.$emit('yudingcheliangfanhui') // 到父页面 |
|||
}, |
|||
// 序号 |
|||
indexMethod(index) { |
|||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
// 查询列表信息 |
|||
getList() { |
|||
this.listLoading = true |
|||
getList({ |
|||
current: this.listQuery.current, |
|||
size: this.listQuery.size, |
|||
params: { |
|||
modelName: this.listQuery.modelName, |
|||
carModel: this.listQuery.carModel, |
|||
brandName: this.listQuery.brandName |
|||
} |
|||
}).then((response) => { |
|||
console.log('列表查询结果:', response) |
|||
this.listLoading = false |
|||
if ( |
|||
response.code === '200' && |
|||
response.data && |
|||
response.data.total > 0 |
|||
) { |
|||
this.list = response.data.records |
|||
this.total = response.data.total |
|||
} else { |
|||
this.list = [] |
|||
this.total = 0 |
|||
} |
|||
}) |
|||
}, |
|||
// 查询按钮 |
|||
handleFilter() { |
|||
this.listQuery.current = 1 |
|||
this.getList() |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped lang="scss"> |
|||
.el-input__icon { |
|||
width: 40px; |
|||
} |
|||
|
|||
.el-form-item .el-form-item__label { |
|||
width: 100% !important; |
|||
} |
|||
|
|||
.block { |
|||
display: inline-block; |
|||
} |
|||
|
|||
.el-form-item__content label { |
|||
padding: 0 5px; |
|||
} |
|||
</style> |
@ -0,0 +1,269 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div v-show="viewState == 1"> |
|||
<div class="tab-header webtop"> |
|||
<div>选择客户</div> |
|||
<div> |
|||
<el-button type="primary" size="small" @click="handleCreate()">新增客户</el-button> |
|||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
</div> |
|||
<div class=""> |
|||
<div class="searchcon"> |
|||
<div v-show="isSearchShow" class="search"> |
|||
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header"> |
|||
<el-form-item label="客户姓名"> |
|||
<el-input v-model="listQuery.params.name" placeholder="请输入" clearable class="filter-item"/> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="btn" style="text-align: center;"> |
|||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- <pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>--> |
|||
<div class=""> |
|||
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%" @selection-change="handleSelectionChange"> |
|||
<el-table-column fixed width="80px" label="序号" type="index" :index="indexMethod" align="center"/> |
|||
<el-table-column fixed label="操作" align="center"> |
|||
<template slot-scope="scope"> |
|||
<div class="searchbtns"> |
|||
<el-button size="small" type="primary" @click="handleConfirm(scope.row)">选择</el-button> |
|||
<el-button size="small" type="primary" @click="handleUpdate(scope.row)">编辑</el-button> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="登记日期" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.createTime }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="客户名称" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.name }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="手机号码" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.mobile }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="微信号" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.weixin }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="客户类型" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.customerType }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="客户级别" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.level }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</div> |
|||
<div class="pages"> |
|||
<div class="tit"/> |
|||
<!-- 翻页 --> |
|||
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<xuanzekehu-add v-show="viewState == 2 || viewState == 3" ref="addAndUpdate" @reloadlist="resetState" @doback="resetState"/> |
|||
<el-dialog title="客户登记-类型" :visible.sync="dialogVisible" width="28%" top="13%"> |
|||
<el-form :model="customerTypeList"> |
|||
<el-form-item label="联络方式" :label-width="formLabelWidth" class="diaForm"> |
|||
<el-select v-model="customerTypeList.visitWay" placeholder="请选择" @change="getVisitWay"> |
|||
<el-option v-for="(item) in visitWay_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="客户类型" :label-width="formLabelWidth" class="diaForm"> |
|||
<el-select v-model="customerTypeList.customerType" placeholder="请选择" @change="getCustomerType"> |
|||
<el-option v-for="(item) in customertype_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"/> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form> |
|||
<span slot="footer" class="dialog-footer"> |
|||
<el-button class="el-button-sure" type="primary" @click="handleOpen()">确 定</el-button> |
|||
<el-button @click="dialogVisible = false">取 消</el-button> |
|||
</span> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from '@/components/pagination' |
|||
import pageye from '@/components/pagination/pageye' |
|||
import { pagerList, typeValues } from '@/api/jichuxinxi/busdepositvehicle' |
|||
import xuanzekehuAdd from './xuanzekehuAdd.vue' |
|||
|
|||
export default { |
|||
name: 'xuanzekehu', |
|||
components: { |
|||
Pagination, |
|||
pageye, |
|||
xuanzekehuAdd |
|||
}, |
|||
data() { |
|||
return { |
|||
dialogVisible: false, // 弹窗 |
|||
formLabelWidth: '110px', |
|||
isSearchShow: true, |
|||
viewState: 1, // 1、列表 2、添加-车辆预定 3、编辑 4、查看 5、订金-定金收取 |
|||
// 查询 ----------- |
|||
tableKey: 0, |
|||
list: [], |
|||
sids: [], |
|||
customerTypeList: { |
|||
visitWay: '', // 联络方式 |
|||
visitWayKey: '', // 联络方式--Key |
|||
customerType: '', // 客户类型 |
|||
customerTypeKey: '', // 客户类型--Key |
|||
psid: '' |
|||
}, |
|||
visitWay_list: [], |
|||
customertype_list: [], |
|||
listLoading: false, |
|||
listQuery: { |
|||
current: 1, |
|||
size: 10, |
|||
total: 0, |
|||
params: { |
|||
name: '', |
|||
userSid: '' |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
init() { |
|||
this.getList() |
|||
this.getShuJUZiDian() |
|||
}, |
|||
getShuJUZiDian() { |
|||
typeValues({ type: 'visitWay' }).then((res) => { |
|||
if (res.code === '200') { |
|||
this.visitWay_list = res.data |
|||
} |
|||
}) |
|||
typeValues({ type: 'customertype' }).then((res) => { |
|||
if (res.code === '200') { |
|||
this.customertype_list = res.data |
|||
} |
|||
}) |
|||
}, |
|||
handleOpen() { |
|||
this.viewState = 2 |
|||
if (this.customerTypeList.visitWay !== '' && this.customerTypeList.customerType !== '') { |
|||
this.dialogVisible = false |
|||
const customerTypeList = this.customerTypeList |
|||
this.$refs['addAndUpdate'].openCreate(customerTypeList) |
|||
this.customerTypeList = { |
|||
visitWay: '', // 联络方式 |
|||
visitWayKey: '', // 联络方式--Key |
|||
customerType: '', // 客户类型 |
|||
customerTypeKey: '', // 客户类型--Key |
|||
psid: '' |
|||
} |
|||
} else { |
|||
this.$message({ |
|||
message: '请填写联络方式和客户类型', |
|||
type: 'warning' |
|||
}) |
|||
} |
|||
}, |
|||
getVisitWay(value) { |
|||
let bb = null |
|||
this.visitWay_list.forEach((e) => { |
|||
if (e.dictValue === value) { |
|||
bb = { |
|||
value: e.dictValue, |
|||
key: e.dictKey |
|||
} |
|||
} |
|||
}) |
|||
this.customerTypeList.visitWay = bb.value |
|||
this.customerTypeList.visitWayKey = bb.key |
|||
}, |
|||
getCustomerType(value) { |
|||
let bb = null |
|||
this.customertype_list.forEach((e) => { |
|||
if (e.dictValue === value) { |
|||
bb= { |
|||
value: e.dictValue, |
|||
key: e.dictKey, |
|||
sid: e.sid |
|||
} |
|||
} |
|||
}) |
|||
this.customerTypeList.customerType = bb.value |
|||
this.customerTypeList.customerTypeKey = bb.key |
|||
this.customerTypeList.psid = bb.sid |
|||
}, |
|||
// ----------功能打开开始-------- |
|||
handleCreate() { |
|||
this.dialogVisible = true |
|||
}, |
|||
resetState() { |
|||
this.viewState = 1 |
|||
this.getList() |
|||
}, |
|||
// 返回 |
|||
handleReturn() { |
|||
this.$emit('doback') |
|||
}, |
|||
// 序号 |
|||
indexMethod(index) { |
|||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
// 查询列表信息 |
|||
getList() { |
|||
this.listLoading = true |
|||
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid') |
|||
pagerList(this.listQuery).then((response) => { |
|||
this.listLoading = false |
|||
if (response.code === '200' && response.data && response.data.total > 0) { |
|||
this.list = response.data.records |
|||
this.listQuery.total = response.data.total |
|||
} else { |
|||
this.list = [] |
|||
this.listQuery.total = 0 |
|||
} |
|||
}) |
|||
}, |
|||
// 查询按钮 |
|||
handleFilter() { |
|||
this.listQuery.current = 1 |
|||
this.getList() |
|||
}, |
|||
// 勾选 |
|||
handleSelectionChange(row) { |
|||
const aa = [] |
|||
row.forEach((element) => { |
|||
aa.push(element.sid) |
|||
}) |
|||
this.sids = aa |
|||
console.log('选择sid', this.sids) |
|||
}, |
|||
// 确认选择客户 |
|||
handleConfirm(row) { |
|||
this.$emit('handleCustomer', row) |
|||
}, |
|||
handleUpdate(row) { |
|||
this.viewState = 3 |
|||
this.$refs['addAndUpdate'].openUpdate(row.sid) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.searchcon { |
|||
margin-top: 8px; |
|||
} |
|||
</style> |
@ -0,0 +1,948 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div> |
|||
<div class="tab-header webtop"> |
|||
<div>【新增】客户信息</div> |
|||
<div> |
|||
<el-button type="primary" size="small" icon="" @click="handleJUBuCun()">保存</el-button> |
|||
<el-button type="info" size="small" icon="el-icon-close" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
</div> |
|||
<div class=""> |
|||
<div class="titwu">客户信息</div> |
|||
<el-form ref="dataForm" :model="temp" label-position="top" class="formadd" :rules="rules"> |
|||
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px"> |
|||
<div>基础信息</div> |
|||
</div> |
|||
<el-row> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">客户名称</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item prop="name"> |
|||
<el-input v-model="temp.name" maxlength="20" placeholder="请输入客户名称" style="width:50%" class="addinputw" clearable/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">客户类型</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item prop="weChatID"> |
|||
<span>{{ temp.customerType }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">联系电话</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item prop="mobile"> |
|||
<el-input v-model="temp.mobile" maxlength="20" placeholder="请输入联系电话" style="width:50%" class="addinputw" clearable/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">微信号</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item prop="weixin"> |
|||
<el-input v-model="temp.weixin" maxlength="20" placeholder="请输入微信号" style="width:50%" class="addinputw" clearable/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row v-show="temp.customerType==='个人'"> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">公司名称</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="20"> |
|||
<el-form-item prop="company"> |
|||
<el-input v-model="temp.companyName" maxlength="20" placeholder="请输入公司名称" style="width:81%" class="addinputw" clearable/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">客户地址</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="20"> |
|||
<el-form-item> |
|||
<el-select v-model="temp.province" filterable placeholder="请选择省" class="addinputw" style="width:160px" @change="getShen"> |
|||
<el-option v-for="item in inputProvinceList" :key="item.sid" :label="item.name" :value="item.sid"/> |
|||
</el-select> |
|||
<el-select v-model="temp.city" filterable placeholder="请选择市" class="addinputw" style="width:160px" @change="getShi"> |
|||
<el-option v-for="item in inputCityList" :key="item.sid" :label="item.name" :value="item.sid"/> |
|||
</el-select> |
|||
<el-select v-model="temp.county" filterable placeholder="请选择县" class="addinputw" style="width:160px" @change="getQu"> |
|||
<el-option v-for="item in inputCountyList" :key="item.sid" :label="item.name" :value="item.sid"/> |
|||
</el-select> |
|||
<el-input v-model="temp.address" style="width:46%" clearable/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">客户级别</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item prop="level"> |
|||
<el-select v-model="temp.level" class="addinputw" placeholder="请选择客户级别" style="width:50%" @change="getJiBie"> |
|||
<el-option v-for="(item, index) in induslevel" :key="index.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" v-show="stateId=='0'" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">是否开启提醒</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8" v-show="stateId=='0'"> |
|||
<el-form-item> |
|||
<el-radio v-model="temp.isOnRemind" label="是">是</el-radio> |
|||
<el-radio v-model="temp.isOnRemind" label="否">否</el-radio> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row v-show="temp.isOnRemind=='是'"> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">提醒日期</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<el-date-picker v-model="temp.remind_day" type="date" style="width:50%" value-format="yyyy-MM-dd" placeholder="选择日期"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">提醒备注</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<el-input v-model="temp.remind_remark" maxlength="20" style="width:50%" placeholder="请输入提醒备注" class="addinputw" clearable/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<!--更多信息--> |
|||
<el-collapse v-model="activeNames"> |
|||
<el-collapse-item title="更多信息" name="2"> |
|||
<el-row v-show="temp.customerType==='个人'"> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">客户生日</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<el-date-picker v-model="temp.birthday" style="width:50%" type="date" format="yyyy-MM-dd" class="addinputw" value-format="yyyy-MM-dd" placeholder="请选择"/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">性别</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<el-radio v-model="temp.sex" label="男">男</el-radio> |
|||
<el-radio v-model="temp.sex" label="女">女</el-radio> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">证件类型</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<el-input v-model="temp.certificateType" style="width:50%" maxlength="20" :readonly="true" class="addinputw" clearable/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">证件号码</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<el-input v-model="temp.idnumber" style="width:50%" maxlength="20" placeholder="请输入证件号码" class="addinputw" clearable/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">证件有效期</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<el-date-picker v-model="temp.endDate" style="width:50%" type="date" format="yyyy-MM-dd" class="addinputw" value-format="yyyy-MM-dd" placeholder="请选择"/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">电子邮件</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<el-input v-model="temp.e_mail" maxlength="20" style="width:50%" placeholder="请输入电子邮箱" class="addinputw" clearable/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">紧急联系人</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<el-input v-model="temp.contacts" maxlength="20" style="width:50%" placeholder="请输入紧急联系人" class="addinputw" clearable/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">紧急联系电话</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<el-input v-model="temp.emergencyMobile" maxlength="20" style="width:50%" placeholder="请输入紧急联系电话" class="addinputw" clearable/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">客户来源</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<el-select v-model="temp.source" class="addinputw" style="width:50%" placeholder="请选择客户来源" @change="getKeHuLaiYUan"> |
|||
<el-option v-for="(item, index) in sourceLisst" :key="index.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">客户分类</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<el-select v-model="temp.customerClass" style="width:50%" class="addinputw" placeholder="请选择客户分类" @change="getFenLei"> |
|||
<el-option v-for="(item, index) in merClass" :key="index.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">备注</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="20"> |
|||
<el-form-item> |
|||
<el-input v-model="temp.remarks" style="width:81%" maxlength="20" placeholder="请输入备注" class="addinputw" clearable/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<!-- </el-form>--> |
|||
</el-collapse-item> |
|||
</el-collapse> |
|||
<!--运营情况--> |
|||
<el-collapse v-model="activeNames"> |
|||
<el-collapse-item title="运营情况" name="3"> |
|||
<el-form ref="datufrom" :model="templooke" label-position="top" label-width="190px" class="formadd03"> |
|||
<el-row> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">承运货物类型</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<el-select v-model="templooke.consignmentType" style="width:50%" class="addinputw" placeholder="请选择承运货物类型" @change="getHuoWuLeiXing"> |
|||
<el-option v-for="(item, index) in signmentT" :key="index.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">承运货物</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<el-select v-model="templooke.consignment" style="width:50%" class="addinputw" placeholder="请选择承运货物" @change="getHuoWu"> |
|||
<el-option v-for="(item, index) in consign" :key="index.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">运输路线</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<el-input v-model="templooke.hallway_state" style="width:50%" maxlength="20" placeholder="请输入运输路线" class="addinputw" clearable/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">购车状态</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<div class="yihang"> |
|||
<el-checkbox-group v-if="aseType.length > 0" v-model="aseTypeBox" @change="changexuanze"> |
|||
<el-checkbox v-for="item in aseType" :key="item.divtkey" :label="item.divtkey"> |
|||
{{ item.dictValue }} |
|||
</el-checkbox> |
|||
</el-checkbox-group> |
|||
<div class="mw">第<el-input v-model="templooke.purchase_num" :disabled="templooke.purchase_num == '0'" maxlength="10" class="addinputwduan" clearable/>辆</div> |
|||
</div> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">现有车辆</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<el-input style="width:50%" v-model="templooke.existing_vehicles" maxlength="20" placeholder="请输入现有车辆" class="addinputw" clearable/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">现有车辆品牌</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item> |
|||
<el-input style="width:50%" v-model="templooke.existing_vehiclesBrand" maxlength="20" placeholder="请输入现有车辆品牌" class="addinputw" clearable/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item> |
|||
<span slot="label">备注</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="20"> |
|||
<el-form-item> |
|||
<el-input style="width:81%" v-model="templooke.remarks" maxlength="20" placeholder="请输入备注" class="addinputw" clearable/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</el-collapse-item> |
|||
</el-collapse> |
|||
<!--见证材料--> |
|||
<el-collapse v-model="activeNames" v-show="stateId=='0'"> |
|||
<el-collapse-item title="见证材料" name="4"> |
|||
<el-form ref="datufrom" :model="templooke" label-position="right" label-width="190px" class="formadd03"> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<span slot="label">文件</span> |
|||
<Upload ref="uploadImg" v-model="list1" :limit="1" bucket="map" :upload-data="{type:'0001'}"/> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</el-collapse-item> |
|||
</el-collapse> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
<!-- 弹框提示 --> |
|||
<el-dialog :visible.sync="dialogFormVisible" width="300px" :close-on-click-modal="false"> |
|||
<div class="result-cont"> |
|||
是否更新用户 |
|||
</div> |
|||
<div slot="footer" v-loading="FormLoading" class="dialog-footer"> |
|||
<el-button @click="dialogFormVisibl()">否</el-button> |
|||
<el-button type="primary" @click="dialogStatus()">是</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { savePcCustomerInfo, getPcCustomerInfoBySid, updatePcCustomerInfo } from '@/api/jichuxinxi/crmcustomer' |
|||
import { getProvince, getCity, getCounty } from '@/api/portal/areaPicker' // 省市区 |
|||
import { typeValues } from '@/api/dictcommons/shujuzidian' |
|||
import { getPcBusinessInfoBySid } from '@/api/jichuxinxi/crmbusiness' |
|||
import Upload from '@/components/uploadFile/upload.vue' // 上传文件 |
|||
|
|||
export default { |
|||
name: 'xuanzekehuAdd', |
|||
components: { Upload }, |
|||
data() { |
|||
var checkSubmit = (rule, value, callback) => { |
|||
const Submit = |
|||
/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/ |
|||
if (Submit.test(value)) { |
|||
return callback() |
|||
} |
|||
callback(new Error('请输入手机号')) |
|||
} |
|||
var identitycard = (rules, value, callback) => { |
|||
const card = |
|||
/^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/ |
|||
if (card.test(value)) { |
|||
return callback() |
|||
} |
|||
callback(new Error('请输入身份证号码')) |
|||
} |
|||
return { |
|||
// ---见证材料 |
|||
list1: [], |
|||
province: [], |
|||
city: [], |
|||
county: [], |
|||
inputProvinceList: [], |
|||
inputCityList: [], |
|||
inputCountyList: [], |
|||
list: [], |
|||
activeNames: ['1'], |
|||
// --按钮菜单------- |
|||
customerClass: 'customerClass', |
|||
merClass: [], |
|||
customerSource: 'customerSource', |
|||
sourceLisst: [], |
|||
customerLevel: 'customerLevel', |
|||
induslevel: [], |
|||
visitWay: 'visitWay', |
|||
industway: [], |
|||
documenttype: 'documenttype', |
|||
cateType: [], |
|||
consignmentType: 'consignmentType', |
|||
signmentT: [], |
|||
consignment: 'consignment', |
|||
consign: [], |
|||
industrytype: 'industrytype', |
|||
industry_type: [], |
|||
customerType_list: [], |
|||
sex_list: [], |
|||
aseTypeBox: [], |
|||
aseType: [ |
|||
{ |
|||
dictValue: '首次购车', |
|||
divtkey: 0 |
|||
}, |
|||
{ |
|||
dictValue: '续购', |
|||
divtkey: 1 |
|||
} |
|||
], |
|||
stateId: 0, |
|||
FormLoading: false, |
|||
listLoading: false, |
|||
crmVisitAppendixDtoList: [], |
|||
temp: { |
|||
crmBusinessDto: {}, |
|||
crmVisitAppendixDtoList: [], |
|||
customerType: '', // 客户类型 |
|||
visitWay: '', // 见面方式 |
|||
visitWayKey: '', |
|||
userSid: '' |
|||
}, // 添加和修改 |
|||
templooke: {}, |
|||
dialogFormVisible: false, |
|||
rules: { |
|||
name: [{ required: true, message: '请填写客户名称', trigger: 'blur' }], |
|||
address: [{ required: true, message: '请填写客户地址', trigger: 'blur' }] |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
// 初始 |
|||
init() { |
|||
this.getShuJUZiDian() |
|||
this.huoquSheng() |
|||
}, |
|||
// 修改回显 |
|||
openUpdate(sid) { |
|||
this.stateId = sid |
|||
this.isOnRemind = '否' |
|||
this.init() |
|||
if (this.stateId !== '0') { |
|||
getPcCustomerInfoBySid(this.stateId).then((response) => { |
|||
console.log(response.data) |
|||
if (response.code === '200') { |
|||
this.$refs['dataForm'].clearValidate() |
|||
this.temp = response.data |
|||
this.temp.birthday = this.getDates(this.temp.birthday) |
|||
if (this.temp.customerType !== '') { |
|||
typeValues({ type: 'customerType' }).then((res) => { |
|||
if (res.code === '200') { |
|||
if (this.temp.customerType === '个人') { |
|||
this.temp.certificateType = '身份证' |
|||
this.temp.certificateTypeKey = '01' |
|||
} else { |
|||
this.temp.certificateType = '营业执照' |
|||
this.temp.certificateTypeKey = '02' |
|||
} |
|||
this.customerType_list = res.data |
|||
this.customerType_list.forEach((e) => { |
|||
if (e.dictValue === this.temp.customerType) { |
|||
typeValues({ psid: e.sid, type: this.customerClass }).then((res) => { |
|||
if (res.code === '200') { |
|||
this.merClass = res.data |
|||
} |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
getPcBusinessInfoBySid(this.stateId).then((response) => { |
|||
if (response.code === '200') { |
|||
this.templooke = response.data |
|||
// 选择框回显 |
|||
const Arry = [] |
|||
Arry.push(parseInt(response.data.purchase_time)) |
|||
this.aseTypeBox = Arry |
|||
} |
|||
}) |
|||
} |
|||
}, |
|||
// 新增 |
|||
openCreate(customerTypeList) { |
|||
this.temp.customerType = customerTypeList.customerType |
|||
this.temp.customerTypeKey = customerTypeList.customerTypeKey |
|||
this.temp.visitWay = customerTypeList.visitWay |
|||
this.temp.visitWayKey = customerTypeList.visitWayKey |
|||
this.$refs['dataForm'].clearValidate() |
|||
this.stateId = '0' |
|||
this.init() |
|||
if (this.temp.customerType !== '') { |
|||
if (this.temp.customerType === '个人') { |
|||
this.temp.certificateType = '身份证' |
|||
this.temp.certificateTypeKey = '01' |
|||
} else { |
|||
this.temp.certificateType = '营业执照' |
|||
this.temp.certificateTypeKey = '02' |
|||
} |
|||
typeValues({ psid: customerTypeList.psid, type: this.customerClass }).then((res) => { |
|||
if (res.code === '200') { |
|||
this.merClass = res.data |
|||
} |
|||
}) |
|||
} |
|||
}, |
|||
// --------------------------------------------------------------------------------- |
|||
// ---------------------------客户基础信息方法------------------------------------------------------ |
|||
// --------------------------------------------------------------------------------- |
|||
// 下拉卡框 数据字典 |
|||
getShuJUZiDian() { |
|||
typeValues({ type: this.documenttype }).then((res) => { |
|||
if (res.code === '200') { |
|||
this.cateType = res.data |
|||
} |
|||
}) |
|||
// |
|||
typeValues({ type: this.customerSource }).then((res) => { |
|||
if (res.code === '200') { |
|||
this.sourceLisst = res.data |
|||
} |
|||
}) |
|||
// |
|||
typeValues({ type: this.customerLevel }).then((res) => { |
|||
if (res.code === '200') { |
|||
this.induslevel = res.data |
|||
} |
|||
}) |
|||
// |
|||
typeValues({ type: this.visitWay }).then((res) => { |
|||
if (res.code === '200') { |
|||
this.industway = res.data |
|||
} |
|||
}) |
|||
// |
|||
typeValues({ type: this.industrytype }).then((res) => { |
|||
if (res.code === '200') { |
|||
this.industry_type = res.data |
|||
} |
|||
}) |
|||
// |
|||
typeValues({ type: this.consignmentType }).then((res) => { |
|||
if (res.code === '200') { |
|||
this.signmentT = res.data |
|||
} |
|||
}) |
|||
// |
|||
typeValues({ type: this.consignment }).then((res) => { |
|||
if (res.code === '200') { |
|||
this.consign = res.data |
|||
} |
|||
}) |
|||
// |
|||
typeValues({ type: 'sex' }).then((res) => { |
|||
if (res.code === '200') { |
|||
this.sex_list = res.data |
|||
} |
|||
}) |
|||
}, |
|||
// -------------------------获取省市县方法------------------------- |
|||
huoquSheng() { |
|||
getProvince().then((res) => { |
|||
if (res.code === '200') { |
|||
this.inputProvinceList = res.data |
|||
} |
|||
}) |
|||
}, |
|||
getShen(value) { |
|||
let bb = '' |
|||
this.inputProvinceList.forEach((e) => { |
|||
if (e.sid === value) { |
|||
bb = { |
|||
name: e.name, |
|||
districtCode: e.districtCode, |
|||
sid: e.sid |
|||
} |
|||
} |
|||
}) |
|||
// 这里是把code的值赋给province省字段 |
|||
this.temp.province = bb.name |
|||
this.huoquShi(bb.sid) |
|||
}, |
|||
huoquShi(sid1) { |
|||
var sid = { |
|||
sid: sid1 |
|||
} |
|||
getCity(sid).then((res) => { |
|||
console.log('2222市', res) |
|||
if (res.code === '200') { |
|||
this.inputCityList = res.data |
|||
} |
|||
}) |
|||
}, |
|||
getShi(value) { |
|||
let bb = '' |
|||
this.inputCityList.forEach((e) => { |
|||
if (e.sid === value) { |
|||
bb = { |
|||
name: e.name, |
|||
districtCode: e.districtCode, |
|||
sid: e.sid |
|||
} |
|||
} |
|||
}) |
|||
this.temp.city = bb.name |
|||
this.huoquXian(bb.sid) |
|||
}, |
|||
huoquXian(sid1) { |
|||
var sid = { |
|||
sid: sid1 |
|||
} |
|||
getCounty(sid).then((res) => { |
|||
console.log('333县', res) |
|||
if (res.code === '200') { |
|||
this.inputCountyList = res.data |
|||
} |
|||
}) |
|||
}, |
|||
getQu(value) { |
|||
let bb = '' |
|||
this.inputCountyList.forEach((e) => { |
|||
if (e.sid === value) { |
|||
bb = { |
|||
name: e.name, |
|||
districtCode: e.districtCode, |
|||
sid: e.sid |
|||
} |
|||
} |
|||
}) |
|||
this.temp.county = bb.name |
|||
}, |
|||
// ----------------------------------方法-------------------- |
|||
// 组件返回 |
|||
handleReturn(isreload) { |
|||
if (isreload === 'true') this.$emit('reloadlist') |
|||
this.activeNames = ['1'] |
|||
this.templooke = {} |
|||
this.temp = {} |
|||
this.aseTypeBox = [] |
|||
this.$emit('doback') |
|||
}, |
|||
// 转换时间格式 |
|||
getDates(v) { |
|||
var now = new Date(v) |
|||
var year = now.getFullYear() // 年 |
|||
var month = now.getMonth() + 1 // 月 |
|||
var day = now.getDate() // 日 |
|||
var hh = now.getHours() // 时 |
|||
var mm = now.getMinutes() // 分 |
|||
var ss = now.getSeconds() // 分 |
|||
var clock = year + '-' |
|||
if (month < 10) clock += '0' |
|||
clock += month + '-' |
|||
if (day < 10) clock += '0' |
|||
clock += day + ' ' |
|||
if (hh < 10) clock += '0' |
|||
clock += hh + ':' |
|||
if (mm < 10) clock += '0' |
|||
clock += mm + ':' |
|||
if (ss < 10) clock += '0' |
|||
clock += ss |
|||
return clock |
|||
}, |
|||
// 首次 续购 处理 |
|||
findselect(list, value) { |
|||
var item = null |
|||
for (var i = 0; i < list.length; i++) { |
|||
if (list[i].divtkey === value) { |
|||
item = list[i] |
|||
break |
|||
} |
|||
} |
|||
return item |
|||
}, |
|||
// 首次 续购 |
|||
changexuanze() { |
|||
this.aseTypeBox = [this.aseTypeBox[this.aseTypeBox.length - 1]] |
|||
const item = this.findselect(this.aseType, this.aseTypeBox[0]) |
|||
this.templooke.purchase_time = item.divtkey |
|||
}, |
|||
// 保存客户运营数据 |
|||
handleJUBuCun() { |
|||
this.$refs['dataForm'].validate((valid) => { |
|||
if (valid) { |
|||
this.FormLoading = true |
|||
if (this.temp.sex !== '') { |
|||
this.sex_list.forEach((e) => { |
|||
if (e.dictValue === this.temp.sex) { |
|||
this.temp.sexKey = e.dictKey |
|||
} |
|||
}) |
|||
} |
|||
if (this.temp.isOnRemind !== '' && this.temp.isOnRemind === '是') { |
|||
this.temp.isOnRemindkey = 1 |
|||
} else { |
|||
this.temp.isOnRemindkey = 0 |
|||
} |
|||
if (!this.temp.birthday) { |
|||
this.temp.birthday = '' |
|||
} |
|||
if (this.stateId === '0') { |
|||
this.temp.userSid = window.sessionStorage.getItem('userSid') |
|||
this.temp.crmBusinessDto = this.templooke |
|||
this.getUrl() |
|||
this.temp.crmVisitAppendixDtoList = this.crmVisitAppendixDtoList |
|||
savePcCustomerInfo(this.temp).then((response) => { |
|||
this.FormLoading = false |
|||
if (response.code === '200') { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '添加成功', |
|||
type: 'success', |
|||
duration: 2000 |
|||
}) |
|||
this.list1 = [] |
|||
this.handleReturn('true') |
|||
} else if ('511' === response.code || '513' === response.code) { |
|||
this.FormLoading = false |
|||
this.dialogFormVisible = true |
|||
this.stateId = response.data |
|||
} else { |
|||
alert(200) |
|||
} |
|||
}).catch(() => {}) |
|||
} else { |
|||
this.temp.userSid = window.sessionStorage.getItem('userSid') |
|||
this.temp.crmBusinessDto = this.templooke |
|||
updatePcCustomerInfo(this.temp).then((res) => { |
|||
this.FormLoading = false |
|||
if (res.code === '200') { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '修改成功', |
|||
type: 'success', |
|||
duration: 2000 |
|||
}) |
|||
this.handleReturn('true') |
|||
} else { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '修改失败', |
|||
type: 'error', |
|||
duration: 2000 |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
}, |
|||
dialogStatus() { |
|||
this.dialogFormVisible = false |
|||
this.openUpdate(this.stateId) |
|||
}, |
|||
dialogFormVisibl() { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '用户名手机号重复', |
|||
type: 'error', |
|||
duration: 2000 |
|||
}) |
|||
this.dialogFormVisible = false |
|||
return |
|||
}, |
|||
// 客户分类 |
|||
getFenLei(value) { |
|||
let bb = null |
|||
this.merClass.forEach((e) => { |
|||
if (e.dictKey === value) { |
|||
bb = { |
|||
type: 'customerClass', |
|||
name: e.dictValue, |
|||
vaule: e.dictKey |
|||
} |
|||
} |
|||
}) |
|||
this.temp.customerClass = bb.name |
|||
this.temp.customerClassKey = bb.vaule |
|||
}, |
|||
// 客户来源 |
|||
getKeHuLaiYUan(value) { |
|||
let bb = null |
|||
this.sourceLisst.forEach((e) => { |
|||
if (e.dictKey === value) { |
|||
bb = { |
|||
type: 'customerSource', |
|||
name: e.dictValue, |
|||
vaule: e.dictKey |
|||
} |
|||
} |
|||
}) |
|||
this.temp.source = bb.name |
|||
this.temp.sourceKey = bb.vaule |
|||
}, |
|||
// 客户级别 |
|||
getJiBie(value) { |
|||
let bb = null |
|||
this.induslevel.forEach((e) => { |
|||
if (e.dictKey === value) { |
|||
bb = { |
|||
type: 'customerLevel', |
|||
name: e.dictValue, |
|||
vaule: e.dictKey |
|||
} |
|||
} |
|||
}) |
|||
this.temp.level = bb.name |
|||
this.temp.levelKey = bb.vaule |
|||
}, |
|||
// 货物类别 |
|||
getHuoWuLeiXing(value) { |
|||
let bb = null |
|||
this.signmentT.forEach((e) => { |
|||
if (e.dictKey === value) { |
|||
bb = { |
|||
type: 'consignmentType', |
|||
name: e.dictValue, |
|||
vaule: e.dictKey |
|||
} |
|||
} |
|||
}) |
|||
this.templooke.consignmentType = bb.name |
|||
this.templooke.consignmentTypeKey = bb.vaule |
|||
}, |
|||
// 货物 |
|||
getHuoWu(value) { |
|||
let bb = null |
|||
this.consign.forEach((e) => { |
|||
if (e.dictKey === value) { |
|||
bb = { |
|||
type: 'consignment', |
|||
name: e.dictValue, |
|||
vaule: e.dictKey |
|||
} |
|||
} |
|||
}) |
|||
this.templooke.consignment = bb.name |
|||
this.templooke.consignmentKey = bb.vaule |
|||
}, |
|||
// ------------------------------见证材料-------------------------------- |
|||
getUrl() { |
|||
for (var i = 0; i < this.list1.length; i++) { |
|||
var namese = this.list1[i].name |
|||
var nameArr = namese.split('.') |
|||
this.crmVisitAppendixDtoList.push({ |
|||
// attachType: '0001', |
|||
fileName: this.list1[i].name, |
|||
filePath: this.list1[i].url, |
|||
fileSize: this.list1[i].size, |
|||
// linkSid: this.temp.customerSid, |
|||
createBySid: window.sessionStorage.getItem('userSid'), |
|||
fileType: nameArr[nameArr.length - 1] |
|||
}) |
|||
console.log('11223344', this.crmVisitAppendixDtoList) |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
|
|||
.trightb { |
|||
text-align: right; |
|||
} |
|||
|
|||
.addinputwduan { |
|||
width: 80px; |
|||
margin: 0 5px; |
|||
} |
|||
|
|||
/deep/ .el-collapse-item__header { |
|||
height: 40px; |
|||
padding: 10px; |
|||
font-weight: bold; |
|||
font-size: 20px; |
|||
text-align: left; |
|||
color: #ffffff; |
|||
background-color: #0294d7; |
|||
} |
|||
|
|||
/deep/ .el-collapse-item__content { |
|||
padding-bottom: 0; |
|||
} |
|||
.titwu { |
|||
font-size: 28px; |
|||
text-align: center; |
|||
padding: 30px 0 20px 0; |
|||
} |
|||
</style> |
File diff suppressed because it is too large
Loading…
Reference in new issue