main
kgdxpr 2 years ago
parent ad2d9a26d9
commit 3df69d1964

@ -39,7 +39,7 @@
<div class="layui-card-body">
<table id="data-table"></table>
<script type="text/html" id="fill-progress">
<span style="cursor: pointer;" onclick='fill_progress("{{= d.job_id }}","{{= d.forward_count }}","{{= d.forward_fill_count }}","{{= d.job_type }}")'>{{= d.forward_fill_count }} / {{= d.forward_count }}</span>
<span style="cursor: pointer;" onclick='fill_progress("{{= d.child_job_id }}","{{= d.forward_count }}","{{= d.forward_fill_count }}","{{= d.job_type }}")'>{{= d.forward_fill_count }} / {{= d.forward_count }}</span>
</script>
</div>
</div>

@ -104,7 +104,7 @@
url: '/QingLong/collect/viewJob',
where: {
job_id: jobId,
fill_type_id: 2,
fill_type_id: 1,
is_finish: $("#status").val(),
keyword: $("#org_name").val()
},

@ -132,63 +132,65 @@
var filesData = render.getFiles();
filesData = unique(filesData);
var file_input_id = filesData[0].select.substring(4);
for (var i = 0; i < filesData.length; i++) {
upload.render({
elem: '#' + filesData[i].select
, elemList: $('#list-' + filesData[i].select.substring(4)) //列表元素对象
, url: '/QingLong/collect/uploadFile'
, data: { job_id: jobId, input_id: filesData[i].select.substring(4), type_id: 1 }
, accept: 'file'
, multiple: true
, number: 3
, auto: true
, bindAction: '#listAction-' + filesData[i].select.substring(4)
, choose: function (obj) {
var that = this;
var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
//读取本地文件
obj.preview(function (index, file, result) {
var tr = $(['<tr id="upload-' + index + '">'
, '<td>' + file.name + '</td>'
, '<td>' + (file.size / 1014).toFixed(1) + 'kb</td>'
, '<td><div class="layui-progress" lay-filter="progress-demo-' + index + '"><div class="layui-progress-bar" lay-percent=""></div></div></td>'
, '<td>'
, '<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>'
, '</td>'
, '</tr>'].join(''));
//删除
tr.find('.demo-delete').on('click', function () {
delete files[index]; //删除对应的文件
tr.remove();
// uploadListIns.config.elem.next()[0].value = ''; //清空 input file 值,以免删除后出现同名文件不可选
if (filesData.length > 0) {
var file_input_id = filesData[0].select.substring(4);
for (var i = 0; i < filesData.length; i++) {
upload.render({
elem: '#' + filesData[i].select
, elemList: $('#list-' + filesData[i].select.substring(4)) //列表元素对象
, url: '/QingLong/collect/uploadFile'
, data: { job_id: jobId, input_id: filesData[i].select.substring(4), type_id: 1 }
, accept: 'file'
, multiple: true
, number: 3
, auto: true
, bindAction: '#listAction-' + filesData[i].select.substring(4)
, choose: function (obj) {
var that = this;
var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
//读取本地文件
obj.preview(function (index, file, result) {
var tr = $(['<tr id="upload-' + index + '">'
, '<td>' + file.name + '</td>'
, '<td>' + (file.size / 1014).toFixed(1) + 'kb</td>'
, '<td><div class="layui-progress" lay-filter="progress-demo-' + index + '"><div class="layui-progress-bar" lay-percent=""></div></div></td>'
, '<td>'
, '<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>'
, '</td>'
, '</tr>'].join(''));
//删除
tr.find('.demo-delete').on('click', function () {
delete files[index]; //删除对应的文件
tr.remove();
// uploadListIns.config.elem.next()[0].value = ''; //清空 input file 值,以免删除后出现同名文件不可选
});
that.elemList.append(tr);
element.render('progress'); //渲染新加的进度条组件
});
that.elemList.append(tr);
element.render('progress'); //渲染新加的进度条组件
});
}, done: function (res, index, upload) { //成功的回调
var that = this;
var tr = that.elemList.find('tr#upload-' + index)
, tds = tr.children();
tds.eq(3).html(''); //清空操作
delete this.files[index]; //删除文件队列已经上传成功的文件
return;
this.error(index, upload);
}, allDone: function (obj) { //多文件上传完毕后的状态回调
setTimeout(function () {
reloadFiles(file_input_id);
}, 700);
}, error: function (index, upload) { //错误回调
var that = this;
var tr = that.elemList.find('tr#upload-' + index)
, tds = tr.children();
tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示重传
}, progress: function (n, elem, e, index) {
element.progress('progress-demo-' + index, n + '%'); //执行进度条。n 即为返回的进度百分比
}
});
}, done: function (res, index, upload) { //成功的回调
var that = this;
var tr = that.elemList.find('tr#upload-' + index)
, tds = tr.children();
tds.eq(3).html(''); //清空操作
delete this.files[index]; //删除文件队列已经上传成功的文件
return;
this.error(index, upload);
}, allDone: function (obj) { //多文件上传完毕后的状态回调
setTimeout(function () {
reloadFiles(file_input_id);
}, 700);
}, error: function (index, upload) { //错误回调
var that = this;
var tr = that.elemList.find('tr#upload-' + index)
, tds = tr.children();
tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示重传
}, progress: function (n, elem, e, index) {
element.progress('progress-demo-' + index, n + '%'); //执行进度条。n 即为返回的进度百分比
}
});
}
}
}, error: function (xhr, status, error) {
layer.msg("获取任务信息异常!", {
@ -273,6 +275,7 @@
//监听提交
form.on('submit(demo1)', function (data) {
var json = render.getFormData();
console.log(json);
$.ajax({
url: '/QingLong/collect/saveFormJob',
type: 'post',

Loading…
Cancel
Save