1204 lines
58 KiB
PHP
1204 lines
58 KiB
PHP
<style>
|
|
.el-input__inner {
|
|
background-color: white !important;
|
|
}
|
|
|
|
.el-input__inner {
|
|
height: 36.8px;
|
|
|
|
/* 设置输入框高度 */
|
|
</style>
|
|
</style>
|
|
<div class="am-form am-form-horizontal" style="width: 98%;padding-top: 10px">
|
|
<div id="vue-edit">
|
|
<div class="am-g">
|
|
<div class="col-sm-12 mb25">
|
|
<div class="col-sm-2" style="padding-left: 0px;">
|
|
<div class="my-panel">
|
|
<div class="text-center">
|
|
状态
|
|
</div>
|
|
<div class="text-center pt5">
|
|
<select id="status" v-model="info.status" disabled="disabled"
|
|
@change='getStatus2();'>
|
|
<template v-for="(v,i) in infoShow.statusList">
|
|
<option :value="v.id">{{v.name}}</option>
|
|
</template>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-2">
|
|
<div class="my-panel">
|
|
<div class="text-center">
|
|
二级状态
|
|
</div>
|
|
<div class="text-center pt5">
|
|
<select id="status2" v-model="info.status2" disabled="disabled">
|
|
<option value="0">二级状态</option>
|
|
<template v-for="(v,i) in infoShow.status2List">
|
|
<option :value="v.id">{{v.name}}</option>
|
|
</template>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-inline pr10 pt10">
|
|
<div class="text-right">
|
|
<div class="am-form-group ml10">
|
|
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-default"
|
|
@click="editType(1)" v-if="info.editType==1">取消编辑</a>
|
|
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-default"
|
|
@click="editType(1)" v-else>编辑状态</a>
|
|
</div>
|
|
<div class="am-form-group ml10" v-if="info.editType==1">
|
|
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
|
|
@click="saveEdit(1)">修改状态</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="am-u-lg-12">
|
|
<div class="am-panel am-panel-default">
|
|
<div class="am-panel-hd">
|
|
<span href="javascript:void(0)" style="font-size: 20px">
|
|
客户信息
|
|
</span>
|
|
</div>
|
|
<div class="am-panel-bd am-g">
|
|
<table width="100%" style="margin:0px 0px 10px 0px;">
|
|
<tr>
|
|
<td class="table-td">
|
|
<div class="input-group">
|
|
<div class="input-group-addon">客户姓名:</div>
|
|
<input style="width: 100px;" type="text" v-model="info.name"
|
|
placeholder="请输入客户姓名">
|
|
</div>
|
|
</td>
|
|
<td class="table-td">
|
|
<div class="input-group">
|
|
<div class="input-group-addon">手机号码:</div>
|
|
<input style="width: 150px;" type="text" v-model="info.mobile"
|
|
placeholder="请输入手机号">
|
|
<!--a data-modal="/common/show_sms?id=<?= $info['id'] ?>&type=clues" data-title="发送短信" class="am-btn am-btn-sm am-btn-success ml10">短信</a-->
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="table-td">
|
|
<div class="am-para-inline ml30">添加微信:</div>
|
|
<div class="am-para-inline w100" style="margin: 0">
|
|
<select title="添加微信" name="info.wxgr" v-model="info.wxgr">
|
|
<option value="">请选择</option>
|
|
<option value="1" <?= $info['wxgr'] == 1 ? 'selected' : '' ?>>是</option>
|
|
<option value="0" <?= $info['wxgr'] == 0 ? 'selected' : '' ?>>否</option>
|
|
</select>
|
|
</div>
|
|
</td>
|
|
<td class="table-td">
|
|
<div class="input-group-addon">关注车型:</div>
|
|
<div class="input-group-addon">
|
|
<el-select v-model="info.brand_id" filterable placeholder="请选择" clearable>
|
|
<el-option
|
|
v-for="item in brandAry"
|
|
:key="item.id"
|
|
:label="item.name"
|
|
:value="item.id">
|
|
</el-option>
|
|
</el-select>
|
|
<!--
|
|
<select name="info.brand_id" v-model="info.brand_id">
|
|
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
|
|
</select>
|
|
-->
|
|
</div>
|
|
<div class="input-group-addon" style="width:160px;">
|
|
<select name="info.series_id" v-model="info.series_id" class="ml5">
|
|
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
|
|
</select>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="table-td">
|
|
<div class="am-para-inline ml30">所在地区:</div>
|
|
<div class="am-para-inline w100" style="margin: 0">
|
|
<select name="info.province_id" v-model="info.province_id">
|
|
<option value="0">省份</option>
|
|
<option :value="v.id" v-for="(v,i) in provinceAry">{{v.name}}</option>
|
|
</select>
|
|
</div>
|
|
<div class="am-para-inline w100">
|
|
<select name="info.city_id" v-model="info.city_id">
|
|
<option value="0">城市</option>
|
|
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
|
|
</select>
|
|
</div>
|
|
<div class="am-para-inline w180">
|
|
<select name="info.county_id" v-model="info.county_id" class="w180">
|
|
<option value="0">行政区</option>
|
|
<option :value="v.id" v-for="(v,i) in countyAry">{{v.name}}</option>
|
|
</select>
|
|
</div>
|
|
</td>
|
|
<td class="table-td">
|
|
<div class="input-group-addon">客户来源:</div>
|
|
<div class="input-group-addon">
|
|
<select name="info.cf_id" v-model="info.cf_id">
|
|
<option value="0">请选择</option>
|
|
<option :value="i" v-for="(v,i) in cfroms">{{v}}</option>
|
|
</select>
|
|
</div>
|
|
<div class="input-group-addon" style="width:160px;">
|
|
<select name="info.cf2_id" v-model="info.cf2_id" class="ml5">
|
|
<option value="0">请选择</option>
|
|
<option :value="i" v-for="(v,i) in cfroms2">{{v}}</option>
|
|
</select>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="table-td">
|
|
<div class="input-group">
|
|
<div class="input-group-addon">首次留资:</div>
|
|
{{infoShow.c_time}}
|
|
</div>
|
|
</td>
|
|
<td class="table-td">
|
|
<div class="input-group">
|
|
<div class="input-group-addon">最新留资:</div>
|
|
{{infoShow.en_time}}
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="table-td">
|
|
<div class="input-group">
|
|
<div class="input-group-addon">意向购车周期:</div>
|
|
<el-select clearable v-model="info.buy_time">
|
|
<el-option label="请选择" value="0"></el-option>
|
|
<el-option
|
|
v-for="(item,index) in buyTimeList"
|
|
:key="index"
|
|
:label="item"
|
|
:value="index">
|
|
</el-option>
|
|
</el-select>
|
|
</div>
|
|
<!--
|
|
<div class="input-group">
|
|
<div class="input-group-addon">平安推荐:</div>
|
|
<el-select v-model="info.cf_pid" filterable placeholder="请选择" clearable>
|
|
<el-option
|
|
v-for="item in paicUser"
|
|
:key="item.id"
|
|
:label="item.name"
|
|
:value="item.id">
|
|
</el-option>
|
|
</el-select>
|
|
</div>
|
|
-->
|
|
</td>
|
|
<td class="table-td">
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="table-td">
|
|
<div class="input-group" style="margin-left: 30px;">
|
|
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
|
|
@click="saveEdit(2)">保存</a>
|
|
<!--
|
|
<a href="javascript:void(0);"
|
|
data-modal="/common/bind_mobile?id=<?= $info['id'] ?>&type=clues"
|
|
class="am-btn am-btn-sm am-btn-danger ml20" data-title="获取手机号">拨打</a>
|
|
-->
|
|
<a data-ajax="get" data-action="/common/bind_mobile"
|
|
data-params-id="<?= $info['id'] ?>" data-params-type="clues"
|
|
class="am-btn am-btn-sm am-btn-danger ml20">
|
|
拨打
|
|
</a>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="am-u-lg-12">
|
|
<div class="am-panel am-panel-default">
|
|
<div class="am-panel-hd">
|
|
<span href="javascript:void(0)" style="font-size: 20px">
|
|
留资记录
|
|
</span>
|
|
</div>
|
|
<div class="am-panel-bd">
|
|
<el-table :data="tableData" style="width: 100%">
|
|
<el-table-column prop="sid" label="编号">
|
|
</el-table-column>
|
|
<el-table-column prop="mobile" label="手机号">
|
|
</el-table-column>
|
|
<el-table-column prop="brandName" label="关注品牌车型">
|
|
</el-table-column>
|
|
<el-table-column prop="cfrom2" label="留资渠道">
|
|
</el-table-column>
|
|
<el-table-column prop="c_time" label="时间">
|
|
</el-table-column>
|
|
</el-table>
|
|
<el-pagination
|
|
class="mt10 text-center"
|
|
@size-change="handleSizeChange"
|
|
@current-change="handleCurrentChange"
|
|
:current-page="currentPage"
|
|
:page-sizes="[10, 20, 30, 50]"
|
|
:page-size="pageSize"
|
|
layout="total, sizes, prev, pager, next"
|
|
:total="total">
|
|
</el-pagination>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="am-u-lg-12">
|
|
<div class="am-panel am-panel-default">
|
|
<div class="am-panel-hd">
|
|
<span href="javascript:void(0)" style="font-size: 20px">
|
|
派单信息
|
|
</span>
|
|
</div>
|
|
<div class="am-panel-bd am-g">
|
|
<table width="100%" style="margin:0px 0px 10px 0px;">
|
|
<tr>
|
|
<td class="table-td">
|
|
<div class="am-para-inline ml30">派单门店:</div>
|
|
<template v-if="info.app_id==1">
|
|
<div>
|
|
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-default"
|
|
@click="brandModal1">+选择门店</a>
|
|
<el-tag v-for="item in selectedBrands1" class="ml5" closable
|
|
@close="delCustomer(item)">{{item.name}}
|
|
</el-tag>
|
|
</div>
|
|
</template>
|
|
<template v-else>
|
|
<div class="am-para-inline w100" style="margin: 0">
|
|
<select name="info.province_id_admin" v-model="info.province_id_admin">
|
|
<option value="0">省份</option>
|
|
<option :value="v.province_id" v-for="(v,i) in admins.provinceAry">
|
|
{{v.province_name}}
|
|
</option>
|
|
</select>
|
|
</div>
|
|
<div class="am-para-inline w100">
|
|
<select name="info.city_id_admin" v-model="info.city_id_admin">
|
|
<option value="0">城市</option>
|
|
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
|
|
</select>
|
|
</div>
|
|
<div class="am-para-inline w180">
|
|
<select name="info.county_id_admin" v-model="info.county_id_admin" class="w180">
|
|
<option value="0">行政区</option>
|
|
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
|
|
</select>
|
|
</div>
|
|
<div class="am-para-inline w180">
|
|
<select name="info.biz_id" v-model="info.biz_id">
|
|
<option value="0">门店</option>
|
|
<option :value="v.id" v-for="(v,i) in admins.bizAry">{{v.title}}</option>
|
|
</select>
|
|
</div>
|
|
<div class="am-para-inline" style="margin-left: 30px;">
|
|
<?php if ($info['biz_id']) { ?>
|
|
<?php if (!$info['customer_id']) { ?>
|
|
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-danger"
|
|
@click="saveEdit(4)">转交门店跟踪</a>
|
|
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
|
|
@click="saveEdit(5)">改派门店</a>
|
|
<?php } else { ?>
|
|
<a href="javascript:void(0)"
|
|
data-open="/receiver/customer/get?id=<?= $info['customer_id'] ?>"
|
|
class="am-btn am-btn-sm am-btn-default">门店跟进中</a>
|
|
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
|
|
@click="saveEdit(5)">另派门店</a>
|
|
<?php }
|
|
} else { ?>
|
|
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
|
|
@click="saveEdit(3)">确认派单</a>
|
|
<?php } ?>
|
|
</div>
|
|
</template>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<template v-if="info.app_id==1">
|
|
<td class="table-td">
|
|
<!--
|
|
<div class="am-para-inline ml30">回收时间:</div>
|
|
<div class="am-para-inline w200">
|
|
<input type="text" autocomplete="off" id="id-create-time"
|
|
v-model="info.rec_time">
|
|
</div>
|
|
-->
|
|
<div class="am-para-inline ml30">
|
|
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
|
|
@click="saveCustomer()">确认派单</a>
|
|
</div>
|
|
</td>
|
|
</template>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="am-u-lg-12">
|
|
<div class="am-panel am-panel-default">
|
|
<div class="am-panel-hd">
|
|
<span href="javascript:void(0)" style="font-size: 20px">
|
|
跟进日志
|
|
</span>
|
|
<span style="float:right;margin-top:5px">
|
|
<a href="javascript:void(0)" @click="logModal()">新增小记</a>
|
|
</span>
|
|
</div>
|
|
<div class="am-panel-bd">
|
|
<div class="am-tabs" data-am-tabs>
|
|
<div class="am-tab-panel am-active">
|
|
<table class="am-table">
|
|
<thead>
|
|
<tr>
|
|
<th width="15%"><span>操作人员</span></th>
|
|
<th width=""><span>内容</span></th>
|
|
<th width="13%"><span>类型</span></th>
|
|
<th width="15%"><span>操作时间</span></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($info_show['logsList'] as $key => $val) { ?>
|
|
<tr>
|
|
<td style="vertical-align:middle;word-wrap:break-word"><?= $val['uname'] ?></td>
|
|
<td style="vertical-align:middle;word-wrap:break-word">
|
|
<? if ($val['rec_url']) { ?>
|
|
<audio controls="controls">
|
|
<source src="<?= $val['rec_url'] ?>"/>
|
|
</audio>
|
|
<? } else if ($val['rec_text']) { ?>
|
|
<?= $val['rec_text'] ?>
|
|
<? } else { ?>
|
|
<?= $val['log'] ?>
|
|
<? } ?>
|
|
</td>
|
|
<td style="vertical-align:middle;word-wrap:break-word"><?= $val['type_name'] ?></td>
|
|
<td style="vertical-align:middle;word-wrap:break-word;"><?= $val['c_time'] ?></td>
|
|
</tr>
|
|
<?php } ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="log-modal" style="display: none;">
|
|
<div style="padding-top: 20px;">
|
|
<!--
|
|
<div class="am-form-group">
|
|
<label class="am-para-label label-width w150">意向购车周期:</label>
|
|
<div class="am-para-input">
|
|
<el-select clearable v-model="goods.buy_time">
|
|
<el-option
|
|
v-for="(item,index) in buyTimeList"
|
|
:key="index"
|
|
:label="item"
|
|
:value="index">
|
|
</el-option>
|
|
</el-select>
|
|
</div>
|
|
</div>
|
|
-->
|
|
<div class="am-form-group">
|
|
<label class="am-para-label label-width w150">内容:</label>
|
|
<div class="am-para-input wp80" style="margin-left: 150px">
|
|
<textarea name="log" rows="5" placeholder="请输入内容" v-model="goods.log"></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="brand-modal1" style="display:none">
|
|
<div class="modal-body">
|
|
<div class="header">
|
|
<div class="am-form am-form-horizontal">
|
|
<div class="am-form-group fl">
|
|
<div class="am-form-group am-para-inline w150">
|
|
<el-select v-model="search_info.brand_id" filterable placeholder="品牌" clearable>
|
|
<el-option
|
|
v-for="item in brandAry"
|
|
:key="item.id"
|
|
:label="item.name"
|
|
:value="item.id">
|
|
</el-option>
|
|
</el-select>
|
|
</div>
|
|
<div class="am-form-group am-para-inline w150">
|
|
<select title="城市" v-model="info.province_id_admin">
|
|
<option value="0">省份</option>
|
|
<template v-for="(v,i) in admins.provinceAry">
|
|
<option :value="v.province_id">{{v.province_name}}</option>
|
|
</template>
|
|
</select>
|
|
</div>
|
|
<div class="am-form-group am-para-inline w150">
|
|
<select title="城市" v-model="info.city_id_admin">
|
|
<option value="0">城市</option>
|
|
<template v-for="(v,i) in admins.cityAry">
|
|
<option :value="v.id">{{v.name}}</option>
|
|
</template>
|
|
</select>
|
|
</div>
|
|
<div class="am-form-group am-para-inline w150">
|
|
<select title="行政区" v-model="info.county_id_admin">
|
|
<option value="0">行政区</option>
|
|
<template v-for="(v,i) in admins.countyAry">
|
|
<option :value="v.id">{{v.name}}</option>
|
|
</template>
|
|
</select>
|
|
</div>
|
|
<div class="am-form-group fl ml10">
|
|
<a class="am-btn am-btn-success am-btn-sm w100" @click="search1()">搜索</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div style="padding-top: 10px;">
|
|
<div class="vuetable-body-wrapper">
|
|
<table class="vuetable table table-middle table-hover fixed">
|
|
<colgroup>
|
|
<col class="vuetable-col-title" style="width: 50%;">
|
|
<col class="vuetable-col-actions text-right" style="width: 10%;">
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<th class="vuetable-th-slot-title">门店</th>
|
|
<th class="vuetable-th-slot-actions text-right">操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tfoot></tfoot>
|
|
<tbody class="vuetable-body">
|
|
<tr v-for="(v,i) in brandsList1">
|
|
<td class="vuetable-slot">
|
|
{{v.name}}
|
|
</td>
|
|
<td class="vuetable-slot text-right">
|
|
<button type='button' v-if="v.is_checked==0 || !v.is_checked"
|
|
class="btn btn-sm btn-success"
|
|
@click="addItem1(i)">添加
|
|
</button>
|
|
<button type='button' v-if="v.is_checked==1" class="btn btn-sm btn-danger"
|
|
@click="removeItem1(v)">删除
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix">
|
|
<span class="pull-left text-muted">第{{brandsPage.page}}页(每页{{brandsPage.pageLimit}}条,共{{brandsPage.pageCount}}条)</span>
|
|
<nav class="pull-right" aria-label="Page navigation">
|
|
<ul class="pagination pagination-sm">
|
|
<li>
|
|
<a href="javascript:void(0);" @click="beforeShopPage1();" aria-label="上一页">
|
|
<span class="glyphicon glyphicon-menu-left"></span>
|
|
</a>
|
|
</li>
|
|
<li v-if="brandsPage.hasNext">
|
|
<a href="javascript:void(0);" @click="afterShopPage1();" aria-label="下一页">
|
|
<span class="glyphicon glyphicon-menu-right"></span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
|
|
require(['laydate'], function (laydate) {
|
|
laydate.render({
|
|
elem: '#id-create-time',
|
|
type: 'datetime'
|
|
});
|
|
});
|
|
|
|
var vue_obj;
|
|
$(document).ready(function () {
|
|
vue_obj = new Vue({
|
|
el: '#vue-edit',
|
|
data: {
|
|
info: {},
|
|
infoShow: {},
|
|
goods: {log: '', id: <?=$info['id']?>, type: 0, buy_time: ''},
|
|
provinceAry: [],
|
|
cityAry: [],
|
|
countyAry: [],
|
|
cfroms: [],
|
|
cfroms2: [],
|
|
brandAry: [],
|
|
seryAry: [],
|
|
admins: {
|
|
provinceAry: <?=json_encode($provinces, JSON_UNESCAPED_UNICODE)?>,
|
|
cityAry: [],
|
|
countyAry: [],
|
|
bizAry: []
|
|
},
|
|
paicUser: [],
|
|
search_info: {province_id: 0, city_id: 0, county_id: 0, brand_id: ''},
|
|
brandsPage: [],
|
|
bizIds: [],
|
|
brandsList1: [],
|
|
brandsThPage: 0,
|
|
selectedBrands1: [],
|
|
tableData: [],
|
|
currentPage: 1,
|
|
total: 0,
|
|
pageSize: 10,
|
|
buyTimeList: []
|
|
},
|
|
mounted: function () {
|
|
var that = this;
|
|
that.info = <?=json_encode($info)?>;
|
|
that.infoShow = <?=json_encode($info_show)?>;
|
|
that.cfroms = <?=json_encode($cfromAry, JSON_UNESCAPED_UNICODE)?>;
|
|
that.cfroms2 = <?=json_encode($cfromAry2, JSON_UNESCAPED_UNICODE)?>;
|
|
that.selectedBrands1 = <?=json_encode($selectedBrands1, JSON_UNESCAPED_UNICODE)?>;
|
|
that.buyTimeList = <?=json_encode($buyTimeList, JSON_UNESCAPED_UNICODE)?>;
|
|
that.init_provinces();
|
|
that.init_brands();
|
|
that.get_series();
|
|
this.loadPaicUser();
|
|
},
|
|
computed: {},
|
|
created: function () {
|
|
this.loadModelList();
|
|
},
|
|
updated: function () {
|
|
},
|
|
methods: {
|
|
loadPaicUser() {
|
|
let that = this
|
|
$.get('/common/get_paic_users', {}, function (response) {
|
|
that.paicUser = response.data
|
|
})
|
|
},
|
|
init_brands: function () {
|
|
var vm = this;
|
|
$.get('/common/auto', {'type': 1, 'tp': 0}, function (response) {
|
|
vm.brandAry = response.data;
|
|
})
|
|
},
|
|
get_series: function () {
|
|
var vm = this;
|
|
vm.seryAry = {};
|
|
$.get('/common/auto', {'type': 2, 'tp': 0, 'pid': vm.info.brand_id}, function (response) {
|
|
vm.seryAry = response.data;
|
|
// if (if_reset) {
|
|
// vm.params.series_id = 0;
|
|
// vm.params.car_id = 0;
|
|
// }
|
|
})
|
|
},
|
|
init_provinces: function () {
|
|
var vm = this;
|
|
$.get('common/area', {}, function (response) {
|
|
if (response.code == 1) {
|
|
vm.provinceAry = response.data;
|
|
}
|
|
});
|
|
},
|
|
init_bizs: function () {
|
|
var vm = this;
|
|
$.ajax({
|
|
type: 'get',
|
|
url: '/biz/store/store/json_lists',
|
|
dataType: 'json',
|
|
data: {
|
|
province_id: vm.info.province_id_admin,
|
|
city_id: vm.info.city_id_admin,
|
|
county_id: vm.info.county_id_admin,
|
|
status: 1
|
|
},
|
|
success: function (response) {
|
|
if (response.code == 1) {
|
|
vm.admins.bizAry = response.data.list;
|
|
}
|
|
}
|
|
});
|
|
},
|
|
editType: function (index) {
|
|
var vm = this;
|
|
if (index == 1) {
|
|
if (vm.info.editType == 1) {
|
|
$("#status").attr("disabled", "disabled");
|
|
$("#status2").attr("disabled", "disabled");
|
|
vm.info.editType = 0;
|
|
} else {
|
|
$("#status").removeAttr("disabled");
|
|
$("#status2").removeAttr("disabled");
|
|
vm.info.editType = 1;
|
|
}
|
|
} else {
|
|
if (vm.info.editType == index) {
|
|
vm.info.editType = 0;
|
|
} else {
|
|
vm.info.editType = index;
|
|
}
|
|
}
|
|
},
|
|
getStatus2: function () {
|
|
//二级分类
|
|
var vm = this;
|
|
$.ajax({
|
|
url: '/receiver/clues/get_status2',
|
|
type: 'post',
|
|
dataType: 'json',
|
|
data: {
|
|
status: vm.info.status,
|
|
},
|
|
success: function (data) {
|
|
vm.info.status2 = 0;
|
|
if (data.data) {
|
|
vm.infoShow.status2List = data.data;
|
|
}
|
|
},
|
|
});
|
|
},
|
|
logModal: function () {
|
|
var vm = this;
|
|
layer.open({
|
|
type: 1,
|
|
area: ['50%'], //宽高
|
|
content: $('#log-modal'),
|
|
title: '新增小记',
|
|
shade: false,
|
|
btn: ['保存', '取消'],
|
|
yes: function (index) {
|
|
$.ajax({
|
|
url: '/receiver/clues/add_log',
|
|
type: 'post',
|
|
dataType: 'json',
|
|
data: vm.goods,
|
|
beforeSend: function () {
|
|
layer.load(1, {
|
|
shade: [0.1, '#fff'] //0.1透明度的白色背景
|
|
});
|
|
},
|
|
success: function (data) {
|
|
if (data['code']) {
|
|
layer.msg(data.msg, {
|
|
icon: 1,
|
|
time: 2000
|
|
}, function () {
|
|
$.form.reload();
|
|
});
|
|
} else {
|
|
layer.msg(data.msg, {icon: 2});
|
|
}
|
|
},
|
|
complete: function () {
|
|
layer.closeAll('loading');
|
|
},
|
|
});
|
|
}
|
|
});
|
|
},
|
|
saveEdit: function (editType) {
|
|
var vm = this;
|
|
if (editType != '') {
|
|
vm.info.editType = editType;
|
|
}
|
|
vm.info.rec_time = $("#id-create-time").val();
|
|
$.ajax({
|
|
url: '/receiver/clues/edit',
|
|
type: 'post',
|
|
dataType: 'json',
|
|
data: {
|
|
info: vm.info
|
|
},
|
|
beforeSend: function () {
|
|
layer.load(1, {
|
|
shade: [0.1, '#fff'] //0.1透明度的白色背景
|
|
});
|
|
},
|
|
success: function (data) {
|
|
loading = false;
|
|
if (data['code']) {
|
|
layer.msg(data.msg, {
|
|
icon: 1,
|
|
time: 2000
|
|
}, function () {
|
|
$.form.reload();
|
|
});
|
|
} else {
|
|
layer.msg(data.msg, {icon: 2});
|
|
}
|
|
},
|
|
complete: function () {
|
|
loading = false;
|
|
layer.closeAll('loading');
|
|
},
|
|
});
|
|
},
|
|
randClass: function () {
|
|
var classArr = ['default', 'primary', 'success', 'info', 'warning', 'danger'];
|
|
var rand = Math.floor(Math.random() * classArr.length);
|
|
return classArr[rand]
|
|
},
|
|
brandModal1: function () {
|
|
var that = this;
|
|
layer.open({
|
|
type: 1,
|
|
area: ['60%', '80%'], //宽高
|
|
content: $('#brand-modal1'),
|
|
title: '选择门店',
|
|
shade: false,
|
|
btn: ['选好了'],
|
|
yes: function (index) {
|
|
layer.close(index);
|
|
}
|
|
});
|
|
$.ajax({
|
|
url: '/common/shop_app',
|
|
type: 'post',
|
|
dataType: 'json',
|
|
data: {
|
|
type: [1,5],
|
|
page: that.brandsThPage,
|
|
province_id: that.info.province_id_admin,
|
|
city_id: that.info.city_id_admin,
|
|
county_id: that.info.county_id_admin,
|
|
unset_city_limit: 1,
|
|
car_brand_id: that.search_info.brand_id,
|
|
},
|
|
success: function (json) {
|
|
var brandsList1 = json.data.shopList;
|
|
that.brandsPage = json.data.shopPage;
|
|
brandsList1.map(function (_item, _index) {
|
|
for (var index in that.selectedBrands1) {
|
|
var item = that.selectedBrands1[index];
|
|
var id = that.sys_type_id == 1 ? item.brand_id : item.biz_id;
|
|
if (id == _item.id) {
|
|
brandsList1[_index].is_checked = 1;
|
|
break;
|
|
} else {
|
|
brandsList1[_index].is_checked = 0;
|
|
}
|
|
}
|
|
})
|
|
that.brandsList1 = brandsList1;
|
|
}
|
|
});
|
|
},
|
|
//group_id1
|
|
search1: function () {
|
|
this.changePage1(1);
|
|
},
|
|
changePage1: function (page) {
|
|
var that = this;
|
|
that.brandsThPage = page;
|
|
return this.brandModal1();
|
|
},
|
|
beforeShopPage1: function () {
|
|
var vm = this;
|
|
if (vm.brandsThPage == 1) {
|
|
alert('已经是第一页了');
|
|
return;
|
|
}
|
|
vm.brandsThPage--;
|
|
return this.brandModal1();
|
|
},
|
|
afterShopPage1: function () {
|
|
var vm = this;
|
|
vm.brandsThPage++;
|
|
return this.brandModal1();
|
|
},
|
|
addItem1: function (index) {
|
|
var vm = this;
|
|
var brand_id;
|
|
var biz_id;
|
|
biz_id = vm.brandsList1[index]['id'];
|
|
var _shop = {
|
|
biz_id: biz_id,
|
|
name: vm.brandsList1[index]['name'],
|
|
};
|
|
vm.selectedBrands1.push(_shop);
|
|
vm.brandsList1[index]['is_checked'] = 1;
|
|
},
|
|
removeItem1: function (item) {
|
|
var vm = this;
|
|
this.selectedBrands1 = this.selectedBrands1.filter(function (_item) {
|
|
var id = _item.biz_id > 0 ? _item.biz_id : _item.brand_id;
|
|
return id != item.id;
|
|
})
|
|
|
|
this.brandsList1.map(function (_item, _index) {
|
|
if (item.id == _item.id) {
|
|
vm.brandsList1[_index].is_checked = 0;
|
|
}
|
|
})
|
|
},
|
|
//派单到客户池
|
|
saveCustomer: function () {
|
|
var vm = this;
|
|
vm.info.rec_time = $("#id-create-time").val();
|
|
$.ajax({
|
|
url: '/receiver/clues/add_customer',
|
|
type: 'post',
|
|
dataType: 'json',
|
|
data: {
|
|
bizList: vm.selectedBrands1,
|
|
info: vm.info
|
|
},
|
|
beforeSend: function () {
|
|
layer.load(1, {
|
|
shade: [0.1, '#fff'] //0.1透明度的白色背景
|
|
});
|
|
},
|
|
success: function (data) {
|
|
loading = false;
|
|
if (data['code']) {
|
|
layer.msg(data.msg, {
|
|
icon: 1,
|
|
time: 2000
|
|
}, function () {
|
|
$.form.reload();
|
|
});
|
|
} else {
|
|
layer.msg(data.msg, {icon: 2});
|
|
}
|
|
},
|
|
complete: function () {
|
|
loading = false;
|
|
layer.closeAll('loading');
|
|
},
|
|
});
|
|
},
|
|
delCustomer(item) {
|
|
var vm = this;
|
|
layer.confirm('您确定要删除?', {icon: 3, title: '提示'}, function (index) {
|
|
layer.close(index);
|
|
$.ajax({
|
|
url: '/receiver/clues/edit_customer',
|
|
type: 'post',
|
|
dataType: 'json',
|
|
data: {
|
|
bizId: item.biz_id,
|
|
info: vm.info
|
|
},
|
|
beforeSend: function () {
|
|
layer.load(1, {
|
|
shade: [0.1, '#fff'] //0.1透明度的白色背景
|
|
});
|
|
},
|
|
success: function (data) {
|
|
if (data['code']) {
|
|
layer.msg(data.msg, {
|
|
icon: 1,
|
|
time: 2000
|
|
}, function () {
|
|
$.form.reload();
|
|
});
|
|
} else {
|
|
layer.msg(data.msg, {icon: 2});
|
|
}
|
|
},
|
|
complete: function () {
|
|
layer.closeAll('loading');
|
|
},
|
|
});
|
|
});
|
|
},
|
|
handleSizeChange(size) {
|
|
this.pageSize = size;
|
|
this.currentPage = 1;
|
|
this.loadModelList();
|
|
},
|
|
handleCurrentChange(obj) {
|
|
console.log(obj);
|
|
this.loadModelList();
|
|
},
|
|
loadModelList() {
|
|
let that = this;
|
|
$.get('receiver/clues/lists_enroll', {
|
|
id: <?=$info['id']?>,
|
|
page: that.currentPage,
|
|
size: that.pageSize
|
|
}, function (response) {
|
|
if (response.code) {
|
|
that.tableData = response.data.list;
|
|
that.total = response.data.count;
|
|
} else {
|
|
layer.msg(response.msg, {icon: 2});
|
|
}
|
|
})
|
|
}
|
|
},
|
|
watch: {
|
|
'info.brand_id': function (nv, ov) {
|
|
if (nv !== '') {
|
|
this.get_series()
|
|
}
|
|
},
|
|
'info.province_id': function (nv, ov) {
|
|
var that = this;
|
|
if (nv == '') {
|
|
that.cityAry = [];
|
|
that.info.city_id = '0';
|
|
} else {
|
|
$.get('common/area', {id: nv, key: 'city', type: 1}, function (response) {
|
|
if (response.code == 1) {
|
|
that.cityAry = response.data;
|
|
if (that.info.city_id > 0) {
|
|
var city_id = '0';
|
|
for (var i in that.cityAry) {
|
|
var city = that.cityAry[i];
|
|
if (city.id == that.info.city_id) {
|
|
city_id = city.id;
|
|
break;
|
|
}
|
|
}
|
|
that.info.city_id = city_id;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
},
|
|
'info.city_id': function (nv, ov) {
|
|
var that = this;
|
|
if (nv == '') {
|
|
that.countyAry = [];
|
|
that.info.county_id = '0';
|
|
} else {
|
|
$.get('common/area', {id: nv, key: 'county', type: 1}, function (response) {
|
|
if (response.code == 1) {
|
|
that.countyAry = response.data;
|
|
if (that.info.county_id > 0) {
|
|
var county_id = '0';
|
|
for (var i in that.countyAry) {
|
|
var county = that.countyAry[i];
|
|
if (county.id == that.info.county_id) {
|
|
county_id = county.id;
|
|
break;
|
|
}
|
|
}
|
|
that.info.county_id = county_id;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
},
|
|
'info.province_id_admin': function (nv, ov) {
|
|
var that = this;
|
|
if (nv == '') {
|
|
that.admins.cityAry = [];
|
|
that.info.city_id_admin = '0';
|
|
} else {
|
|
$.get('common/area', {id: nv, key: 'city', type: 1}, function (response) {
|
|
if (response.code == 1) {
|
|
that.admins.cityAry = response.data;
|
|
if (that.info.city_id_admin > 0) {
|
|
var city_id = '0';
|
|
for (var i in that.admins.cityAry) {
|
|
var city = that.admins.cityAry[i];
|
|
if (city.id == that.info.city_id_admin) {
|
|
city_id = city.id;
|
|
break;
|
|
}
|
|
}
|
|
that.info.city_id_admin = city_id;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
},
|
|
'info.city_id_admin': function (nv, ov) {
|
|
var that = this;
|
|
if (nv == '') {
|
|
that.admins.countyAry = [];
|
|
that.county_id_admin = '0';
|
|
} else {
|
|
$.get('common/area', {id: nv, key: 'county', type: 1}, function (response) {
|
|
if (response.code == 1) {
|
|
that.admins.countyAry = response.data;
|
|
if (that.info.county_id_admin > 0) {
|
|
var county_id = '0';
|
|
for (var i in that.admins.countyAry) {
|
|
var county = that.admins.countyAry[i];
|
|
if (county.id == that.info.county_id_admin) {
|
|
county_id = county.id;
|
|
break;
|
|
}
|
|
}
|
|
that.info.county_id_admin = county_id;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
},
|
|
'info.county_id_admin': function (nv, ov) {
|
|
var that = this;
|
|
if (nv == '') {
|
|
that.admins.bizAry = [];
|
|
that.info.biz_id = 0;
|
|
} else {
|
|
$.ajax({
|
|
type: 'get',
|
|
url: '/biz/store/store/json_lists',
|
|
dataType: 'json',
|
|
data: {
|
|
province_id: that.info.province_id_admin,
|
|
city_id: that.info.city_id_admin,
|
|
county_id: that.info.county_id_admin,
|
|
status: 1
|
|
},
|
|
success: function (response) {
|
|
if (response.code == 1) {
|
|
that.admins.bizAry = response.data.list;
|
|
if (that.info.biz_id > 0) {
|
|
var biz_id = 0;
|
|
for (var i in that.admins.bizAry) {
|
|
if (that.info.biz_id == that.admins.bizAry[i].id) {
|
|
biz_id = that.info.biz_id;
|
|
break;
|
|
}
|
|
}
|
|
that.info.biz_id = biz_id;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
},
|
|
'info.cf_id': function (nv, ov) {
|
|
var that = this;
|
|
if (nv == '') {
|
|
that.info.cf2_id = 0;
|
|
that.cfroms2 = [];
|
|
} else {
|
|
$.post('/receiver/clues/json_map_cfrom', {pid: nv, status: 1}, function (result) {
|
|
that.cfroms2 = result.data;
|
|
if (that.info.cf2_id > 0) {
|
|
var cf2_id = 0;
|
|
for (var i in that.cfroms2) {
|
|
if (i == that.info.cf2_id) {
|
|
cf2_id = i;
|
|
break;
|
|
}
|
|
}
|
|
that.info.cf2_id = cf2_id;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
<style type="text/css">
|
|
.input-group {
|
|
width: 100%;
|
|
padding-right: 30px;
|
|
}
|
|
|
|
.input-group-addon {
|
|
padding: 0px 0px 0px 0px;
|
|
font-size: 1.6rem;
|
|
font-weight: normal;
|
|
line-height: 0px;
|
|
color: #333;
|
|
text-align: right;
|
|
background-color: #fff;
|
|
border: 0px solid #fff;
|
|
border-radius: 0px;
|
|
width: 110px;
|
|
}
|
|
|
|
.table-td {
|
|
width: 20%;
|
|
padding-top: 15px;
|
|
line-height: 37px;
|
|
font-size: 1.6rem;
|
|
}
|
|
|
|
.my-ul ul li {
|
|
padding: 10px;
|
|
}
|
|
|
|
.my-panel {
|
|
padding: 10px;
|
|
border: 1px solid #ddd;
|
|
height: 90px;
|
|
}
|
|
|
|
.auto-content {
|
|
width: min-content;
|
|
min-width: 50%;
|
|
}
|
|
|
|
.btn-group .disabled {
|
|
background-color: #eee;
|
|
opacity: 1;
|
|
}
|
|
|
|
.photo-upload {
|
|
position: relative;
|
|
font-size: 0;
|
|
}
|
|
|
|
.photo-upload:after {
|
|
content: "";
|
|
display: table;
|
|
clear: both;
|
|
}
|
|
|
|
.photo-upload-item {
|
|
position: relative;
|
|
float: left;
|
|
margin-right: 10px;
|
|
margin-bottom: 10px;
|
|
font-size: 12px; /*display:inline-block;width:120px;*/
|
|
}
|
|
|
|
.photo-upload-item > img {
|
|
}
|
|
|
|
.photo-upload-item-check,
|
|
.photo-upload-item-remove {
|
|
opacity: 0;
|
|
position: absolute;
|
|
top: -8px;
|
|
right: -8px;
|
|
width: 24px;
|
|
height: 24px;
|
|
line-height: 24px;
|
|
border: 1px solid #fff;
|
|
background-color: #eee;
|
|
border-radius: 50%;
|
|
text-align: center;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.photo-upload-item:hover .photo-upload-item-remove {
|
|
opacity: 1;
|
|
transition: all .4s ease
|
|
}
|
|
|
|
.photo-upload-item-check {
|
|
opacity: 1;
|
|
background-color: #36f;
|
|
color: #fff;
|
|
}
|
|
</style>
|
|
<link rel="stylesheet" type="text/css" href="/static/css/appitem/font-awesome.min.css?v=1581252500">
|