提交 dce2b030 authored 作者: 李思鑫's avatar 李思鑫

诗仙太白经销商导入 个性化

上级 b4aaf756
差异被折叠。
...@@ -1166,6 +1166,7 @@ urlpatterns = [ ...@@ -1166,6 +1166,7 @@ urlpatterns = [
url(r'^company/test/add_user/$', company_views.test_add_user), url(r'^company/test/add_user/$', company_views.test_add_user),
url(r'^company/list/$', sal_views.company_list), url(r'^company/list/$', sal_views.company_list),
url(r'^company/use_excel_upload_companies/$', company_views.use_excel_upload_companies), url(r'^company/use_excel_upload_companies/$', company_views.use_excel_upload_companies),
url(r'^company/use_excel_upload_companies/sxtb/$', company_views.use_excel_upload_companies_sxtb),#lisin 2024-09-27 诗仙太白经销商导入
url(r'^test/send_hb/$', wx_views.test_send_hb), url(r'^test/send_hb/$', wx_views.test_send_hb),
url(r'^test/consumer_winner_hit/$', sal_views.test_consumer_winner_hit), url(r'^test/consumer_winner_hit/$', sal_views.test_consumer_winner_hit),
......
<script type="text/javascript">
$(document).ready(function(){
var page_length = 10;
$("#btn_upload").click(function(){
var files = document.getElementById('input_file').files;
if(files.length> 0){
var file = files[0];
var formData = new FormData();
formData.append('file',file);
$.ajax({
type: 'post',
url: '/company/use_excel_upload_companies/sxtb/',
data: formData,
contentType: false,
processData: false,
cache: false,
success:function(res){
if(res.e===''){
toastr.success("导入成功", "操作提示:",
{ timeOut: 800, positionClass: "toast-center-center" }
);
if(res.repeatAgent.length>0){
$("#tb_agent").fadeIn();
initTable("#tb_agent table",res.repeatAgent)
}
if(res.repeatUser.length>0){
$("#tb_user").fadeIn();
initTable("#tb_user table",res.repeatUser)
}
}
else{
toastError(res.e)
}
},
error: function(){
toastError('网络超时')
}
})
}
else{
toastError('请选择上传文件')
}
})
function toastError(text){
toastr.error(text, "操作错误:",
{ timeOut: 800, positionClass: "toast-center-center" }
);
}
function initTable(el, data) {
var tb = $(el).DataTable({
dom: 'Bfrtip',
autoWidth: true,
destroy: true,
pageLength: page_length,
buttons: [{ extend: 'excelHtml5', text: '导出到Excel' }],
language: lng,
data,
drawCallback: function () {
},
createdRow: function (nRow, aData, iDataIndex) {
}
});
tb.columns().every(function () {
var that = this;
$('input', this.footer()).on('keyup change clear', function () {
if (that.search() !== this.value) {
that.search(this.value).draw();
}
});
});
}
})
</script>
<ol class="breadcrumb">
<li>经销商管理</li>
<li>经销商导入</li>
</ol>
<div>
<!--<button class="btn btn-primary" id="btn_down">模板下载</button>-->
<input type="file" id="input_file"><button class="btn btn-primary" id="btn_upload">上传</button>
<div id='tb_agent' style="display:none;margin-top:20px">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">存在重复的经销商数据</h3>
</div>
<div class="panel-body">
<div class='col-md-12 form-group' >
<div class="table-responsive">
<table class="table table-striped table-bordered dt-responsive nowrap tb"
cellspacing="0" width="100%">
<thead>
<tr>
<th>经销商名称</th>
<th>经销商级别</th>
<th>上级经销商</th>
<th>地址</th>
<th>省份</th>
<th>城市</th>
<th>区县</th>
<th>战区</th>
<th>分区</th>
<th>经销商电话</th>
<th>联系人</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<th><input type="text" placeholder="经销商名称"></th>
<th><input type="text" placeholder="经销商级别"></th>
<th><input type="text" placeholder="上级经销商"></th>
<th><input type="text" placeholder="地址"></th>
<th><input type="text" placeholder="省份"></th>
<th><input type="text" placeholder="城市"></th>
<th><input type="text" placeholder="区县"></th>
<th><input type="text" placeholder="战区"></th>
<th><input type="text" placeholder="分区"></th>
<th><input type="text" placeholder="经销商电话"></th>
<th><input type="text" placeholder="联系人"></th>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
<div id='tb_user' style="display:none;margin-top:20px">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">存在重复的用户帐号数据</h3>
</div>
<div class="panel-body">
<div class='col-md-12 form-group' >
<div class="table-responsive">
<table class="table table-striped table-bordered dt-responsive nowrap tb"
cellspacing="0" width="100%">
<thead>
<tr>
<th>帐号</th>
<th>经销商</th>
<th>注册时间</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<th><input type="text" placeholder="帐号"></th>
<th><input type="text" placeholder="经销商"></th>
<th><input type="text" placeholder="注册时间"></th>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论