Commit f2a18f08 by 匡雅琴

Merge branch 'xuyl_v2.8.0' into kuangyq_v2.8.0

2 parents ae283fa9 9b8745a2
import request from './request'
const path = 'merchants.api.menu.'
const addNamelistApi = {
// 根据商户名称和渠道类型查询商户列表
getMerchantsList(data = {}) {
data.method = 'merchants.api.open.findMerchantList'
return request(data, 'merchants.api.open.findMerchantList', [], 'http://rop-merchant.dev.glsx.com.cn/rop-merchants')
},
// 添加客户名单
}
export { addNamelistApi }
\ No newline at end of file \ No newline at end of file
import request from './request'
const path = 'scrm.api.renewal.insurance.customer.name.list.'
const customerApi = {
// 客户名单列表查询
searchCustomerList(data = {}) {
data.method = `${path}get`
return request(data)
},
// 客户名单同步
synchroCustomerList(data = {}) {
data.method = `${path}sync`
return request(data)
},
// 客户名单删除
deleteCustomerList(data = {}) {
data.method = `${path}delete`
return request(data)
},
// 客户名单查看-门店信息
infoCustomerList(data = {}) {
data.method = `${path}merchant.info`
return request(data)
},
// 客户名单列表导出
exportCustomerList(data = {}) {
data.method = `${path}export`
return request(data)
},
// 添加客户名单
addCustomerList(data = {}) {
data.method = `${path}get`
return request(data)
}
}
export { customerApi }
\ No newline at end of file \ No newline at end of file
<template>
<div>
<div class="biasicInfo">
<div>
基本信息
<hr />
</div>
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="所属商户" prop="merchant">
<el-select
v-model="ruleForm.merchant"
placeholder="请选择商户"
@change="selectChange"
>
<el-option
v-for="(x, i) in merchants"
:key="i"
:label="x.merchantName"
:value="x.merchantName"
></el-option>
</el-select>
</el-form-item>
<div></div>
<el-form-item label="主营品牌" prop="brand">
<el-input
v-model="ruleForm.brand"
placeholder="请输入商户主营品牌"
maxlength="50"
show-word-limit
></el-input>
</el-form-item>
<el-form-item label="商户地址" prop="address">
<el-input
v-model="ruleForm.address"
placeholder="请输入商户地址"
maxlength="100"
show-word-limit
></el-input>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input
type="textarea"
v-model="ruleForm.remarks"
placeholder="请输入备注内容"
maxlength="100"
show-word-limit
></el-input>
</el-form-item>
</el-form>
</div>
<div class="clientInfo">
<div>
客户信息
<hr />
</div>
<div class="upfile">
<p class="fileText"><span class="redPoint">*</span>上传文件</p>
<div class="filebtn">
<div class="upload-btn">
<el-button size="small">
<i class="el-icon-plus"></i>
上传文件
</el-button>
<input
class="uploadInput"
style="opacity: 0"
type="file"
ref="file"
accept="*"
@change="uploadFile"
/>
</div>
<a
class="download"
href="https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/在线名单导入模板-广联.xlsx"
>下载模板</a
>
</div>
</div>
<el-input
class="fileExpand"
v-if="fileName"
v-model="fileName"
></el-input>
<div v-if="hasFile" class="fileError">请上传文件!</div>
</div>
<div class="footerBut">
<el-button plain type="primary" @click="back">取消</el-button>
<el-button type="primary" @click="submitForm">提交</el-button>
</div>
<el-dialog title="提示" :visible.sync="dialogVisible" width="30%">
<template v-if="uploadStatus == 'success'">
<span>数据导入成功!</span>
<p>成功导入{{ upLoadNum }}条客户记录</p>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="back">确 定</el-button>
</span>
</template>
<template v-if="uploadStatus == 'fail'">
<span>数据导入失败,请重试!</span>
<span slot="footer" class="dialog-footer">
<el-button plain type="primary" @click="dialogVisible = false"
>取消</el-button
>
<el-button type="primary" @click="submitForm">重试</el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script>
import { addNamelistApi } from '@/api/addNamelist'
import { customerApi } from '@/api/customer'
export default {
data() {
return {
merchants: [],
upLoadNum: '',
dialogVisible: false,
uploadStatus: '',
hasFile: false,
fileList: [],
fileName: '',
hasFileName: false,
fileBaseUrl: '',
ruleForm: {
merchant: '',
brand: '',
address: '',
remarks: '',
},
rules: {
merchant: [{ required: true, message: '请选择商户', trigger: 'blur' }],
brand: [
{ required: true, message: '请输入商户主营品牌', trigger: 'blur' },
],
address: [
{ required: true, message: '请输入商户地址', trigger: 'blur' },
],
remarks: [{ required: false, trigger: 'blur' }],
},
}
},
async mounted() {
await this.merchantList()
},
watch: {
fileName(val) {
if (val !== '') {
this.hasFile = false
}
},
},
methods: {
// 获取商户列表
merchantList() {
const params = {
accountType: 1,
}
addNamelistApi.getMerchantsList(params).then((res) => {
this.merchants = res.data.data.map((val) => {
return {
merchantName: val.merchantName,
merchantBrandCars: val.merchantBrandCars,
merchantAddress: val.merchantAddress,
}
})
})
},
// 根据所选商户获取品牌和地址
selectChange(label) {
let obj = this.merchants.filter((el) => {
return el.merchantName == label
})
this.$set(this.ruleForm, 'address', obj[0].merchantAddress)
this.$set(this.ruleForm, 'brand', obj[0].merchantBrandCars)
},
submitForm() {
if (this.fileName == '') {
this.hasFile = true
}
this.$refs.ruleForm.validate((valid) => {
if (!this.hasFile && valid) {
let{
address: merchantAddr,
merchant: merchantName,
brand: mainBrandName,
remarks: remark,
} = this.ruleForm
let params = {
merchantAddr,
merchantName,
mainBrandName,
remark,
file: this.fileBaseUrl,
}
console.log(params)
customerApi.addCustomerList(params).then((res) => {
this.dialogVisible =true
this.uploadStatus = 'success'
console.log(res)
},err =>{
this.dialogVisible =true
this.uploadStatus = 'fail'
})
} else {
return false
}
})
},
uploadFile(e) {
const file = e.srcElement.files[0]
let AllImgExt = '.xls|.xlsx'
let extName = file.name
.substring(file.name.lastIndexOf('.'))
.toLowerCase()
if (AllImgExt.indexOf(extName) === -1) {
this.$message.error('上传格式不正确')
return false
}
const size = file.size / 1024 / 1024
if (size > 5) {
this.$message.error('单文件体积需小于5M')
return
}
this.downloadStatus = true
this.setInter = setInterval(this.addProcess, 100)
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = (event) => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const splitStr = file.name.split('.')
const fileUrl = splitStr[splitStr.length - 1] + '@' + arrBase64[1]
this.fileBaseUrl = fileUrl
this.fileName = file.name
// this.$apis.common.pictureUpload({ file: fileUrl }).then(res => {
// if (res) {
// this.importName = file.name
// this.exportUrl = res
// this.handleSaveImport()
// }
// this.$refs.file.value = ''
// })
}
},
back() {
this.$root.to(['ubi续保', '续保', '保险渠道管理', '客户名单管理'])
},
},
}
</script>
<style scoped>
.biasicInfo {
width: 500px;
}
.el-upload-list__item-name {
border: 1px solid yellow;
}
.footerBut {
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
background-color: #fff;
}
.redPoint {
color: red;
}
.upfile {
margin-left: 25px;
display: flex;
align-items: center;
}
.filebtn {
display: flex;
align-items: center;
}
.fileError {
color: red;
margin-left: 100px;
font-size: 1px;
}
.fileText {
font-size: 14px;
margin-right: 10px;
color: #606266;
}
.upload-demo {
padding-left: 10px;
}
.download {
margin-left: 8px;
font-size: 14px;
color: #1994f9;
cursor: pointer;
}
.fileExpand {
width: 300px;
margin-left: 100px;
}
.upload-btn {
position: relative;
display: inline-block;
}
.uploadInput {
cursor: pointer;
position: absolute;
height: 100%;
width: 100%;
top: 0px;
left: 0px;
font-size: 0px;
}
</style>
import App from './index.vue'
import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common'
base.getConfig().then(data => {
const { vue, config } = data
vue.use(GlsxVueCommon, config)
base.render(App)
})
\ No newline at end of file \ No newline at end of file
<template>
<div>
<div>
<div>
<div class="mainTitle">基本信息</div>
<div class="infoBox">
<p class="rowline">
<span class="title">所属商户:</span>
<span>*************</span>
</p>
<p class="rowline">
<span class="title">主营品牌:</span><span>*************</span>
</p>
<p class="rowline">
<span class="title">商户地址:</span>
<span>*************</span>
</p>
<p class="rowline">
<span class="title">备注:</span>
<span>*************</span>
</p>
</div>
</div>
<div>
<div class="mainTitle">客户信息</div>
<d2-table
ref="customerDetail"
:hasNum="false"
:tableParams="customerDetailTableParams"
:searchForm="customerDetailSearchForm"
:getListApi="getListApi"
:pageConf="pageConf"
>
</d2-table>
</div>
</div>
<div class="footerBut">
<el-button @click="back">返回</el-button>
</div>
</div>
</template>
<script>
import { customerApi } from '@/api/customer'
export default {
data() {
return {
customerDetailForm: {
enableStatus: '',
},
pageConf: {
pageSize: 'pageSize',
pageNum: 'pageNum',
totalCount: 'data.count',
},
tableData: [
{
id: 1,
dictName: 'dsfd',
},
],
// getListApi: dictApi.findDictType,
customerDetailTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'data.data',
tableColumns: [
{
label: '投保人名称',
prop: 'id',
width:'120px'
},
{
label: '投保人身份证号',
prop: 'dictName',
width:'170px'
},
{
label: '常用电话',
prop: 'dictType',
},
{
label: '备用电话',
prop: 'remark',
},
{
label: '其他电话',
prop: 'enableStatus',
addHtml: 'status',
},
{
label: '车牌号',
prop: 'createdDate',
},
{
label: '车架号',
prop: 'enableStatus',
addHtml: 'status',
},
{
label: '发动机号',
prop: 'createdDate',
},
{
label: '车辆初登日期',
prop: 'createdDate',
width:'170px'
},
{
label: '最新保单日期',
prop: 'enableStatus',
addHtml: 'status',
width:'170px'
},
{
label: '公共型号',
prop: 'createdDate',
},
{
label: '车辆价值',
prop: 'createdDate',
},
{
label: '厂家型号',
prop: 'enableStatus',
addHtml: 'status',
},
{
label: '车主',
prop: 'createdDate',
},
{
label: '车主证件号码',
prop: 'createdDate',
width:'170px'
},
{
label: '最新保单商业险保单号',
prop: 'enableStatus',
addHtml: 'status',
width:'170px'
},
{
label: '最新保单交强险保单号',
prop: 'createdDate',
width:'170px'
},
{
label: '最新保单下的商业险出险次数',
prop: 'createdDate',
width:'220px'
},
{
label: '最新保单下的交强险出险次数',
prop: 'enableStatus',
width:'220px'
},
{
label: '备注',
prop: 'createdDate',
},
{
label: '年化里程',
prop: 'createdDate',
},
{
label: '车龄',
prop: 'enableStatus',
addHtml: 'status',
},
{
label: '客户状态',
prop: 'createdDate',
},
],
},
}
},
methods:{
back() {
this.$root.to(['ubi续保', '续保', '保险渠道管理', '客户名单管理'])
},
// 客户名单查看-导入门店信息
getcustomerInfo(){
let params = {}
customerApi.infoCustomerList(params).then(res =>{
console.log(res)
})
}
}
}
</script>
<style>
.mainTitle {
height: 40px;
line-height: 40px;
background: #f7f8fa;
color: #333333;
font-weight: 600;
align-items: center;
padding-left: 16px;
}
.infoBox{
padding: 24px 0px 24px 100px;
color: #333333;
font-size: 14px;
}
.rowline {
display: flex;
align-items: center;
width: 560px;
}
.title{
text-align: right;
width: 80px;
}
.footerBut {
position: fixed;
z-index: 100;
bottom: 0;
width: 100%;
text-align: center;
height: 48px;
background-color: #fff;
}
</style>
<!-- -->
<template>
<div>
客户名单管理列表
</div>
</template>
<script>
export default {
data() {
return {
}
}
}
</script>
<style scoped>
</style>
import App from './index.vue'
import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common'
base.getConfig().then(data => {
const { vue, config } = data
vue.use(GlsxVueCommon, config)
base.render(App)
})
<template>
<div>
<el-button class="addList" type="primary" @click="gotoNamelist">
<i class="el-icon-plus"></i>添加名单</el-button
>
<el-button type="text" @click="gotoDetail">查看</el-button>
<el-form
inline="true"
ref="merchantForm"
:model="merchantSearchForm"
label-width="80px"
class="demo-form-inline"
>
<el-form-item label="商户名称">
<el-input
clearable
v-model="merchantSearchForm.merchantName"
placeholder="请输入商户名称"
></el-input>
</el-form-item>
<el-form-item label="商户号">
<el-input
clearable
v-model="merchantSearchForm.merchantId"
placeholder="请输入商户号"
></el-input>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="merchantSearchForm.status" placeholder="请选择状态">
<el-option label="全部" value=""></el-option>
<el-option label="未同步" value="0"></el-option>
<el-option label="已同步" value="2"></el-option>
<el-option label="同步失败" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" :id="merchantTableParams.btnId"
>查询</el-button
>
<el-button @click="reset">重置</el-button>
</el-form-item>
</el-form>
<d2-table
ref="merchantTable"
:hasNum="true"
:tableParams="merchantTableParams"
:searchForm="merchantSearchForm"
:getListApi="getListApi"
:pageConf="pageConf"
>
<!-- <div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="handle('cogradient', scope.scope)"
>同步</el-button
>
<el-button type="text" @click="gotoDetail">查看</el-button>
<el-button type="text" @click="handle('delete')">删除</el-button>
</div> -->
</d2-table>
<el-dialog title="提示" :visible.sync="dialogVisible" width="30%">
<span>{{ dialogVisibleText }}</span>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="comfirmDialog(dialogStatus)"
>确 定</el-button
>
</span>
</el-dialog>
</div>
</template>
<script>
import { customerApi } from '@/api/customer'
export default {
data() {
return {
dialogVisible: false,
dialogStatus: '',
dialogVisibleText:
'确定同步后,客户名单会自动发送给对应的保险合作渠道。是否确认同步?',
merchantSearchForm: {
merchantName: '',
merchantId: '',
status: '',
},
// DICTSTATUS: this.$Constants.DICT_STATUS,
pageConf: {
pageSize: 'pageSize',
pageNum: 'pageNum',
totalCount: 'data.total',
},
// tableData: [
// {
// id: 1,
// dictName: 'list',
// },
// ],
getListApi: customerApi.searchCustomerList,
merchantTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'data.list',
tableColumns: [
{
label: '商户名称',
prop: 'merchantName',
},
{
label: '商户号',
prop: 'merchantId',
},
{
label: '主营品牌',
prop: 'mainBrandName',
},
{
label: '客户数量',
prop: 'customerNumber',
},
{
label: '有效客户数量',
prop: 'validCustomerNumber',
},
{
label: '状态',
prop: 'status',
},
{
label: '创建人',
prop: 'createdBy',
},
{
label: '创建时间',
prop: 'createdDate',
},
// {
// label: '操作',
// prop: 'optionBtns',
// addHtml: 'optionBtns',
// fixed: 'right',
// },
],
},
}
},
methods: {
gotoNamelist() {
this.$root.to([
'ubi续保',
'续保',
'保险渠道管理',
'客户名单管理',
'*添加名单',
])
},
gotoDetail() {
this.$root.to([
'ubi续保',
'续保',
'保险渠道管理',
'客户名单管理',
'*查看客户名单',
])
},
reset() {
this.merchantSearchForm = {}
},
handle(type,scope) {
this.dialogVisible = true
this.dialogStatus = type
if (type == 'delete') {
this.dialogVisibleText = '删除后不可恢复,是否确认删除?'
}
},
comfirmDialog(type) {
if (type == 'cogradient') {
// 合并
customerApi.synchroCustomerList({ id: scope.id }).then(
(res) => {
this.$message.success('合并成功')
},
(err) => {
this.$message.error('合并失败')
}
)
}
// 删除
if (type == 'delete') {
customerApi.deleteCustomerList({ id: scope.id }).then(
(res) => {
this.$message.success('删除成功')
},
(err) => {
this.$message.error('删除失败')
}
)
}
},
},
}
</script>
<style scoped>
.addList {
width: 112px;
background: #1994f9;
border-radius: 2px;
margin-bottom: 24px;
}
.el-icon-plus {
padding-right: 5px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!