Authored by 王涛

Merge branch 'master-mj-yuanjinpengnew' into 'master-mj'

fix:数据库恢复和应急管理新增下载优化



See merge request !1111
... ... @@ -132,7 +132,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
limit: common.limit,
limits: common.limits,
even: true,
cols: [[{
cols: [[{type: 'checkbox'},{
type: 'numbers', title: '序号'
}, {
field: 'title', title: '预案版本', align: 'center',
... ... @@ -203,7 +203,8 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
limit: common.limit,
limits: common.limits,
even: true,
cols: [[{
cols: [[{type: 'checkbox'},
{
type: 'numbers', title: '序号'
}, {
field: 'title', title: '预案版本', align: 'center',
... ... @@ -261,14 +262,30 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
})
//下载
$('#emergency_download').on('click', function (){
let id ='';
var data = [];
var attachmentId ="";
var docType = "";
if (currSelect == 0) {
id = '62a341e759dd46d5b12b4c17ddb9db';
}else{
id = '09f4988f2fc8a785700040c49cfe5d19';
data = table.checkStatus('emergencyPlan_table_id').data;
attachmentId = '62a341e759dd46d5b12b4c17ddb9db';
docType = '1';
}else if (currSelect == 1) {
data = table.checkStatus('emergencyReport-table').data;
attachmentId = '09f4988f2fc8a785700040c49cfe5d19';
docType = '2';
}
var ids = '';
if(data.length<=0){
layer.msg("请至少选择一条下载", { offset: '15px' , icon: 7 , time: 1500 });
}else if(data.length>=1){
var arr = [];
$.each(data,function (i,e) {
arr.push(e.id)
})
ids = arr.toString();
var url = domainName + `/api-web/emergency/downloadWordZipforEmergency?accessToken=` + accessToken+"&ids="+ids+"&attachmentId="+ attachmentId+"&docType="+docType;
window.open(url);
}
var url = domainName + `/api-web/openoffice/download/${id}?accessToken=` + accessToken;
window.open(url);
})
//新增/编辑表单
function openemergencyForm(id) {
... ...
... ... @@ -173,7 +173,6 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect
//绑定业务下拉选择数据
common.bizTypeSelect("slt-biz-add", function () {
form.render("select");
fromAssignment()
});
admin.req({
url: domainName + '/api-web/bWorkreportGroup/findManufacturerList'
... ... @@ -185,7 +184,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect
options += "<option value='0'>其他</option>";
$('#slt-emergencyadd-group').html(options);
form.render();
//fromAssignment();
fromAssignment();
});
}
... ... @@ -356,7 +355,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect
// $('#add-repair-form').find("select[name='hitchtime']").attr("disabled", "disabled")
// $('#add-repair-form').find("input[name='createtime']").attr("disabled", "disabled")
//编辑表单时取消显示默认值
currentDate.config.isInitValue = false
//currentDate.config.isInitValue = false
initDatePlus()
admin.req({
url: domainName + `/api-web/emergency/findBEmergencyRecordByRecordId`,
... ...
... ... @@ -177,15 +177,20 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
//下载
$('#recoveryverify_download').on('click', function (){
var data = table.checkStatus('recoveryverify-table').data;
var attachmentId = '09f4988f2fc8a785700040c49cfe5d12';
var ids = '';
if(data.length<=0){
layer.msg("请选择一条作为下载模板", { offset: '15px' , icon: 7 , time: 1500 });
}else if(data.length>1){
layer.msg("请最多选择一条作为下载模板", { offset: '15px' , icon: 7 , time: 1500 });
}else {
let attachmentId = '09f4988f2fc8a785700040c49cfe5d12';
var url = domainName + `/api-web/word/exportWord?accessToken=` + accessToken+"&attachmentId="+attachmentId+"&recoveryverifyId="+data[0].id;
layer.msg("请至少选择一条下载", { offset: '15px' , icon: 7 , time: 1500 });
}else if(data.length>=1){
var arr = [];
$.each(data,function (i,e) {
arr.push(e.id)
})
ids = arr.toString();
var url = domainName + `/api-web/recoveryverify/downloadWordZipforRecoveryverify?accessToken=` + accessToken+"&ids="+ids+"&attachmentId="+ attachmentId;
window.open(url);
}
})
//新增/编辑表单
function openrecoveryverifyForm(id) {
... ...
... ... @@ -86,7 +86,7 @@
<i class="layui-icon">&#xe624;</i>新增
</button>
<button class="layui-btn layui-btn-sm layui-btn-normal active" data-type="" id="emergency_download" >
<i class="layui-icon">&#xe601;</i>模板下载
<i class="layui-icon">&#xe601;</i>下载
</button>
<button class="layui-btn layui-btn-sm layui-btn-normal active"
id="emergency-export-excel">
... ...
... ... @@ -84,7 +84,7 @@
<i class="layui-icon">&#xe624;</i>新增
</button>
<button class="layui-btn layui-btn-sm layui-btn-normal active" data-type="" id="recoveryverify_download" >
<i class="layui-icon">&#xe601;</i>模板下载
<i class="layui-icon">&#xe601;</i>下载
</button>
<button class="layui-btn layui-btn-sm layui-btn-normal active"
id="recoveryverify-export-excel">
... ...