admin_topic_328_3
This commit is contained in:
@@ -1,470 +1,217 @@
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
||||
<div id="recom-stat"></div>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="<?= !strlen($params['status']) ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/clues">全部</a>
|
||||
</li>
|
||||
<? foreach ($statusList as $v) { ?>
|
||||
<li role="presentation"
|
||||
class="<? if (strlen($params['status']) && $params['status'] == $v['id']) { ?>active<? } ?>">
|
||||
<? if ($v['cate']) { ?>
|
||||
<a href="javascript:void (0);" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<?= $v['name'] ?>
|
||||
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
|
||||
<?= $v['cate'] ? ' <span class="caret"></span>' : '' ?>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<? if ($v['cate']) { ?>
|
||||
<li class="<?= $params['status'] == $v['id'] && !$params['status2'] ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/clues?status=<?= $v['id'] ?>">
|
||||
全部
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
<? foreach ($v['cate'] as $v2) { ?>
|
||||
<li class="<?= $params['status2'] == $v2['id'] ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/clues?status=<?= $v['id'] ?>&status2=<?= $v2['id'] ?>">
|
||||
<?= $v2['name'] ?>
|
||||
<?= $v2['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v2['count'] . '</span>' : '' ?>
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
<? } else { ?>
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/clues?status=<?= $v['id'] ?>">
|
||||
<?= $v['name'] ?>
|
||||
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
|
||||
</a>
|
||||
<? } ?>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="coms-table-wrap mt10">
|
||||
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="/receiver/clues" id="search_form">
|
||||
<input name="status" value="<?= $params['status'] ?>" type="hidden">
|
||||
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="receiver/cluesCfrom">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">客户搜索:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select name="search_tp" id="search_tp">
|
||||
<? foreach ($searchTpAry as $key => $value) { ?>
|
||||
<option value="<?= $key ?>"
|
||||
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
|
||||
<? } ?>
|
||||
</select>
|
||||
<label class="am-para-label w100">一级分类名称:</label>
|
||||
<div class="am-para-inline w200">
|
||||
<input type="text" name="title" value="<?= $params['title'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w260">
|
||||
<input id="title" name="title" type="text" value="<?= $params['title'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">报名位置:</label>
|
||||
<div class="am-form-group am-para-inline w150">
|
||||
<select name="city_id" v-model="city_id">
|
||||
<option value="0">城市</option>
|
||||
<template v-for="(v,i) in cityAry">
|
||||
<option :value="v.id">{{v.name}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-form-group am-para-inline w150">
|
||||
<select name="county_id" v-model="county_id">
|
||||
<option value="0">行政区</option>
|
||||
<template v-for="(v,i) in countyAry">
|
||||
<option :value="v.id">{{v.name}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">线索来源:</label>
|
||||
<div class="am-form-group am-para-inline w150">
|
||||
<select name="cfrom_id" v-model="cfrom_id">
|
||||
<option value=0>请选择</option>
|
||||
<template v-for="(v,i) in cfroms">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-form-group am-para-inline w150">
|
||||
<select name="cfrom_id2" v-model="cfrom_id2">
|
||||
<option value=0>请选择</option>
|
||||
<template v-for="(v,i) in cfroms2">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<label class="am-para-label w100">创建时间:</label>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w300">
|
||||
<input id="id-create-time" name="c_time" type="text" value="<?= $params['c_time'] ?>"
|
||||
placeholder="创建时间范围" autocomplete="off"/>
|
||||
</div>
|
||||
<div class="am-para-inline" style="padding-top: 5px;">
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today"
|
||||
data-source="id-create-time">今日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday"
|
||||
data-source="id-create-time">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks"
|
||||
data-source="id-create-time">本周</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month"
|
||||
data-source="id-create-time">本月</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<label class="am-para-label w100">最后报名时间:</label>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w300">
|
||||
<input id="id-en-time" name="en_time" type="text" value="<?= $params['en_time'] ?>"
|
||||
placeholder="创建时间范围" autocomplete="off"/>
|
||||
</div>
|
||||
<div class="am-para-inline" style="padding-top: 5px;">
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today"
|
||||
data-source="id-en-time">今天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday"
|
||||
data-source="id-en-time">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks"
|
||||
data-source="id-en-time">本周</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month"
|
||||
data-source="id-en-time">本月</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl" style="margin-bottom: 0px;">
|
||||
<div class="am-form-group fl ml30">
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" class="am-btn am-btn-success am-btn-sm w100"
|
||||
onclick="edit_adviser();">分配
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" id="import" class="am-btn am-btn-success am-btn-sm w100">导入</button>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" class="am-btn am-btn-success am-btn-sm w100"
|
||||
data-modal="/receiver/clues/get_add" data-title="新增线索">新增
|
||||
<button data-modal="/receiver/cluesCfrom/get" type="button" data-title="新增一级分类"
|
||||
class="am-btn am-btn-success am-btn-sm">
|
||||
新增一级分类
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="coms-table-bd">
|
||||
<div class="coms-table-bd" id="vue-show">
|
||||
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
|
||||
<table class="am-table am-table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="3%"><label class="checkall">
|
||||
<input type="checkbox" data-check-target=".order-ids"> 全选</label></th>
|
||||
<th width="5%"><span>客户姓名</span></th>
|
||||
<th width="5%"><span>客户电话</span></th>
|
||||
<th width="8%"><span>线索来源</span></th>
|
||||
<th width="8%"><span>状态</span></th>
|
||||
<th width="4%"><span>跟进人</span></th>
|
||||
<th width="7%"><span>创建时间</span></th>
|
||||
<th width="7%"><span>最后报名时间</span></th>
|
||||
<th width="30%"><span>一级分类</span></th>
|
||||
<th width="60%"><span>二级分类</span></th>
|
||||
<th width="5%"><span>排序</span></th>
|
||||
<th width="5%"><span>状态</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<? if ($lists) {
|
||||
<?php if ($lists) {
|
||||
foreach ($lists as $v) { ?>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="ids[]" class="order-ids"
|
||||
value="<?= $v['id'] ?>"/></td>
|
||||
<td><?= $v['name'] ?></td>
|
||||
<td><?= $v['mobile_sub'] ?></td>
|
||||
<td><?= $v['cf_title'] ?></td>
|
||||
<td><? if ($v['cf_id'] == 36 || $v['cf_id'] == 37) { ?>
|
||||
<input type="hidden" class="clues-id-<?= $v['id'] ?>" name="id" value="<?= $v['id'] ?>"
|
||||
checked>
|
||||
<select data-update-group="" data-list-target=".clues-id-<?= $v['id'] ?>"
|
||||
data-action="/receiver/clues/batch" data-field=""
|
||||
style="height: 26px;width: 100px;">
|
||||
<? foreach ($maintainAry as $key => $val) { ?>
|
||||
<option value="<?= $key ?>" <?= $key == $v['status'] . '-' . $v['status2'] ? 'selected' : '' ?>><?= $val ?></option>
|
||||
<? } ?>
|
||||
</select>
|
||||
<? } else { ?>
|
||||
<?= $v['status_name'] ?>
|
||||
<? } ?>
|
||||
</td>
|
||||
<td><?= $v['admin_name'] ?></td>
|
||||
<td><?= date('Y-m-d H:i:s', $v['c_time']) ?></td>
|
||||
<td><?= $v['en_time'] ?></td>
|
||||
<td><?= $v['options'] ?></td>
|
||||
<td><?= $v['sort'] ?></td>
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<div class="row">
|
||||
<div class="col-md-4 align-l">
|
||||
</div>
|
||||
<div class="col-md-8 align-r" style="padding-right: 30px;">
|
||||
<a data-modal="/common/bind_mobile?id=<?= $v['id'] ?>&type=clues"
|
||||
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs"
|
||||
data-title="获取手机号">拨打电话</a>
|
||||
<a data-modal="/common/show_sms?id=<?= $v['id'] ?>&type=clues"
|
||||
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs"
|
||||
data-title="发送短信">短信</a>
|
||||
<a data-open="/receiver/clues/get?id=<?= $v['id'] ?>&type=clues"
|
||||
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs">查看详情</a>
|
||||
</div>
|
||||
<td colspan="4" class="align-r">
|
||||
<a href="javascript:void(0);" data-modal="/receiver/cluesCfrom/get?id=<?= $v['id'] ?>"
|
||||
data-title="编辑一级分类" class="am-btn am-btn-primary am-btn-xs">编辑一级分类</a>
|
||||
<a href="javascript:void(0);" @click="optionsModal(<?= $v['id'] ?>,'<?= $v['name'] ?>')"
|
||||
class="am-btn am-btn-primary am-btn-xs">编辑二级分类</a>
|
||||
<? if ($v['status'] == 1) { ?>
|
||||
<a data-ajax="post" data-action="/receiver/cluesCfrom/edit_status"
|
||||
class="am-btn am-btn-danger am-btn-xs"
|
||||
data-params-id="<?= $v['id'] ?>" data-params-status="0">关闭</a>
|
||||
<?
|
||||
} ?>
|
||||
<? if ($v['status'] == 0) { ?>
|
||||
<a data-ajax="post" data-action="/receiver/cluesCfrom/edit_status"
|
||||
class="am-btn am-btn-success am-btn-xs"
|
||||
data-params-id="<?= $v['id'] ?>" data-params-status="1">开启</a>
|
||||
<? } ?>
|
||||
<a data-ajax="post" data-action="/receiver/cluesCfrom/del"
|
||||
class="am-btn am-btn-danger am-btn-xs"
|
||||
data-params-id="<?= $v['id'] ?>">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
<? }
|
||||
<?php }
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="options-modal" style="display: none;">
|
||||
<table class="table table-hover table-middle" style="table-layout:fixed">
|
||||
<colgroup>
|
||||
<col width="65%">
|
||||
<col width="15%">
|
||||
<col width="">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">分类名称</th>
|
||||
<th class="text-center">排序</th>
|
||||
<th class="text-right">
|
||||
<a href="javascript:" style="margin-top: 2px;" class="btn btn-primary btn-sm"
|
||||
@click='addOptions()'>添加</a>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<template v-for="(item,index) in optionsList">
|
||||
<tr v-if="item.status==1">
|
||||
<td class="text-center">
|
||||
<input :id="'name_'+index" @blur="editName(index)" class="form-control"
|
||||
v-model="item.name" placeholder="请输入分类名称"></td>
|
||||
<td class="text-center">
|
||||
<input :id="'group_name_'+index" @blur="editGroupName(index)" class="form-control"
|
||||
v-model="item.sort" type="number" placeholder="请输入排序值">
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<a href="javascript:void(0);" style="margin-top:2px;"
|
||||
class="btn btn-danger btn-sm" @click='delOptions(index)'>删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="coms-table-ft clearfix">
|
||||
<div class="hander am-form">
|
||||
</div>
|
||||
<div class="coms-pagination fr mr20">
|
||||
<? page_view($pager) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="cule-modal" style="display: none;padding: 10px">
|
||||
<div class="modal-body">
|
||||
<div class="text-center">
|
||||
<h2><i class="fa fa-info-circle"></i> 请上传Excel文件</h2>
|
||||
<p>Excel文件格式必须与模板保持一致,否则无法导入</p>
|
||||
<div class="form-group-action">
|
||||
<a href="/temp/clues.xlsx" target="_blank" class="btn btn-default">查看模板</a>
|
||||
<label href="javascript:" class="btn btn-primary" style="margin-left: 10px;">
|
||||
<form id="import-form">
|
||||
<input type="file" id="clue-file" name="file" accept=".xls,.xlsx"
|
||||
style="left:-9999px;position:absolute;" onchange="load_clue()">
|
||||
</form>
|
||||
<span>上传Excel文件</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<?php page_view($pager) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var vue_obj;
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '#search_form',
|
||||
el: '#vue-show',
|
||||
data: {
|
||||
city_id:<?=$params['city_id'] ? $params['city_id'] : 0?>,
|
||||
county_id:<?=$params['county_id'] ? $params['county_id'] : 0?>,
|
||||
cfrom_id:<?=$params['cfrom_id'] ? $params['cfrom_id'] : 0?>,
|
||||
cfrom_id2:<?=$params['cfrom_id2'] ? $params['cfrom_id2'] : 0?>,
|
||||
cfroms: [],
|
||||
cfroms2: [],
|
||||
cityAry: [],
|
||||
countyAry: []
|
||||
optionsList: [],
|
||||
},
|
||||
mounted: function () {
|
||||
this.getCfroms()
|
||||
this.init_citys();
|
||||
},
|
||||
methods: {
|
||||
init_citys: function () {
|
||||
var vm = this;
|
||||
$.get('common/area', {id: '350', key: 'city', type: 1}, function (response) {
|
||||
if (response.code == 1) {
|
||||
vm.cityAry = response.data;
|
||||
optionsModal: function (id, name) {
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: ['50%', '50%'], //宽高
|
||||
content: $('#options-modal'),
|
||||
title: '编辑【' + name + '】二级分类',
|
||||
shade: false,
|
||||
btn: ['保存', '取消'],
|
||||
yes: function (index) {
|
||||
$.ajax({
|
||||
url: '/receiver/cluesCfrom/edit_options',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {id: id, options: that.optionsList},
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
if (vm.city_id > 0) {
|
||||
$.get('common/area', {id: vm.city_id, key: 'county', type: 1}, function (response) {
|
||||
if (response.code == 1) {
|
||||
vm.countyAry = response.data;
|
||||
var that = this;
|
||||
$.ajax({
|
||||
url: '/receiver/cluesCfrom/get_options',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {id: id},
|
||||
beforeSend: function () {
|
||||
},
|
||||
success: function (re) {
|
||||
if (re.code) {
|
||||
that.optionsList = re.data.lists;
|
||||
} else {
|
||||
layer.msg(re.msg, {icon: 2});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
getCfroms: function () {
|
||||
var that = this
|
||||
$.get('/receiver/CluesCfrom/json_get', function (result) {
|
||||
that.cfroms = result.data.data
|
||||
},
|
||||
complete: function () {
|
||||
}
|
||||
});
|
||||
if (that.cfrom_id > 0) {
|
||||
$.get('/receiver/CluesCfrom/json_get', {'id': that.cfrom_id}, function (result) {
|
||||
that.cfroms2 = result.data.data
|
||||
});
|
||||
},
|
||||
addOptions: function () {
|
||||
var that = this;
|
||||
that.optionsList.push({id: 0, name: '', status: 1, sort: 50});
|
||||
},
|
||||
delOptions: function (index) {
|
||||
var that = this;
|
||||
if (that.optionsList[index]['id'] > 0) {
|
||||
that.optionsList[index]['status'] = -1;
|
||||
} else {
|
||||
that.optionsList.splice(index, 1);
|
||||
}
|
||||
},
|
||||
reset: function () {
|
||||
var that = this;
|
||||
$('#search_tp').val('mobile');
|
||||
$('#title').val('');
|
||||
$('#id-create-time').val('');
|
||||
$('#id-en-time').val('');
|
||||
that.city_id = '0';
|
||||
that.county_id = '0';
|
||||
that.cfrom_id = 0;
|
||||
that.cfrom_id2 = 0;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'city_id': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
that.countyAry = [];
|
||||
that.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.county_id > 0) {
|
||||
var county_id = '0';
|
||||
for (var i in that.countyAry) {
|
||||
var county = that.countyAry[i];
|
||||
if (county.id == that.county_id) {
|
||||
county_id = county.id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
that.county_id = county_id;
|
||||
}
|
||||
}
|
||||
});
|
||||
editName: function (index) {
|
||||
var name = $("#name_" + index).val();
|
||||
if (name == '') {
|
||||
layer.msg("标题不能为空!", {icon: 2});
|
||||
return false;
|
||||
}
|
||||
},
|
||||
'cfrom_id': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
that.cfrom_id2 = 0;
|
||||
that.cfroms2 = [];
|
||||
} else {
|
||||
$.get('/receiver/CluesCfrom/json_get', {'id': nv}, function (result) {
|
||||
that.cfroms2 = result.data.data;
|
||||
if (that.cfrom_id2 > 0) {
|
||||
var cfrom_id2 = '0';
|
||||
for (var i in that.cfroms) {
|
||||
var county = that.cfroms[i];
|
||||
if (county.id == that.cfrom_id2) {
|
||||
cfrom_id2 = county.id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
that.cfrom_id2 = cfrom_id2;
|
||||
}
|
||||
});
|
||||
// 修改排序
|
||||
editGroupName: function (index) {
|
||||
var order_view = $("#group_name_" + index).val();
|
||||
if (order_view == '') {
|
||||
layer.msg("排序值不能为空!", {icon: 2});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#import").click(function () {
|
||||
$("#clue-file").val('');
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: ['40%'], //宽高
|
||||
content: $('#cule-modal'),
|
||||
title: '导入线索',
|
||||
shade: false,
|
||||
btn: ['完成'],
|
||||
yes: function (index) {
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
require(['laydate', 'autocomplete'], function (laydate) {
|
||||
laydate.render({
|
||||
elem: '#id-create-time', range: '~'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#id-en-time', range: '~'
|
||||
});
|
||||
$('.id-day-btn').click(function () {
|
||||
var type = $(this).data('date'), date = '', nowDate = new Date();
|
||||
var source_id = $(this).data('source') || 'id-create-time';
|
||||
var beginDate = '', endDate = '';
|
||||
switch (type) {
|
||||
case 'today':
|
||||
beginDate = endDate = nowDate.Format('yyyy-MM-dd');
|
||||
break;
|
||||
case 'yesterday':
|
||||
beginDate = endDate = (new Date(nowDate.getTime() - 86400000)).Format('yyyy-MM-dd');
|
||||
break;
|
||||
case 'weeks':
|
||||
nowDate.setDate(nowDate.getDate() - nowDate.getDay() + 1);
|
||||
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
|
||||
nowDate.setDate(nowDate.getDate() + 6);
|
||||
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
|
||||
break;
|
||||
case 'month':
|
||||
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-01";
|
||||
var day = new Date(nowDate.getFullYear(), nowDate.getMonth() + 1, 0);
|
||||
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + day.getDate();
|
||||
break;
|
||||
}
|
||||
date = beginDate + ' ~ ' + endDate;
|
||||
$('#' + source_id).val(date);
|
||||
});
|
||||
});
|
||||
|
||||
function edit_adviser() {
|
||||
var ids = function () {
|
||||
var data = [];
|
||||
return $(".order-ids").map(function () {
|
||||
(this.checked) && data.push(this.value);
|
||||
}), data.join(',');
|
||||
}.call(this);
|
||||
if (ids.length < 1) {
|
||||
return $.msg.tips('请选择需要操作的数据!');
|
||||
}
|
||||
return $.form.modal("/receiver/clues/get_adviser?ids=" + ids, 'open_type=modal', "分配顾问");
|
||||
}
|
||||
|
||||
function load_clue() {
|
||||
var file = $("#clue-file");
|
||||
if (file.val() == '') {
|
||||
layer.msg('文件是空的');
|
||||
return 0;
|
||||
}
|
||||
var loading = layer.load(1, {
|
||||
shade: [0.1, '#fff'] //0.1透明度的白色背景
|
||||
});
|
||||
|
||||
var options = {
|
||||
url: "/receiver/clues/add_excel",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {},
|
||||
success: function (res) {
|
||||
if (1 == res.code) {
|
||||
layer.msg(res.msg, {
|
||||
icon: 1,
|
||||
time: 2000
|
||||
}, function () {
|
||||
$.form.reload();
|
||||
});
|
||||
}
|
||||
this.optionsList.sort(function (a, b) {
|
||||
return b.sort - a.sort;
|
||||
})
|
||||
},
|
||||
},
|
||||
complete: function () {
|
||||
file.val('');
|
||||
layer.close(loading);
|
||||
}
|
||||
};
|
||||
$("#import-form").ajaxSubmit(options);
|
||||
}
|
||||
|
||||
</script>
|
||||
watch: {}
|
||||
});
|
||||
<?php page_script($pager) ?>
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user