Merge branch 'master-mj-yuanjinpengnew' into 'master-mj'
fix:数据库恢复和应急管理新增下载优化 See merge request !1111
Showing
5 changed files
with
40 additions
and
19 deletions
@@ -132,7 +132,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat | @@ -132,7 +132,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat | ||
132 | limit: common.limit, | 132 | limit: common.limit, |
133 | limits: common.limits, | 133 | limits: common.limits, |
134 | even: true, | 134 | even: true, |
135 | - cols: [[{ | 135 | + cols: [[{type: 'checkbox'},{ |
136 | type: 'numbers', title: '序号' | 136 | type: 'numbers', title: '序号' |
137 | }, { | 137 | }, { |
138 | field: 'title', title: '预案版本', align: 'center', | 138 | field: 'title', title: '预案版本', align: 'center', |
@@ -203,7 +203,8 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat | @@ -203,7 +203,8 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat | ||
203 | limit: common.limit, | 203 | limit: common.limit, |
204 | limits: common.limits, | 204 | limits: common.limits, |
205 | even: true, | 205 | even: true, |
206 | - cols: [[{ | 206 | + cols: [[{type: 'checkbox'}, |
207 | + { | ||
207 | type: 'numbers', title: '序号' | 208 | type: 'numbers', title: '序号' |
208 | }, { | 209 | }, { |
209 | field: 'title', title: '预案版本', align: 'center', | 210 | field: 'title', title: '预案版本', align: 'center', |
@@ -261,14 +262,30 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat | @@ -261,14 +262,30 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat | ||
261 | }) | 262 | }) |
262 | //下载 | 263 | //下载 |
263 | $('#emergency_download').on('click', function (){ | 264 | $('#emergency_download').on('click', function (){ |
264 | - let id =''; | 265 | + var data = []; |
266 | + var attachmentId =""; | ||
267 | + var docType = ""; | ||
265 | if (currSelect == 0) { | 268 | if (currSelect == 0) { |
266 | - id = '62a341e759dd46d5b12b4c17ddb9db'; | ||
267 | - }else{ | ||
268 | - id = '09f4988f2fc8a785700040c49cfe5d19'; | 269 | + data = table.checkStatus('emergencyPlan_table_id').data; |
270 | + attachmentId = '62a341e759dd46d5b12b4c17ddb9db'; | ||
271 | + docType = '1'; | ||
272 | + }else if (currSelect == 1) { | ||
273 | + data = table.checkStatus('emergencyReport-table').data; | ||
274 | + attachmentId = '09f4988f2fc8a785700040c49cfe5d19'; | ||
275 | + docType = '2'; | ||
276 | + } | ||
277 | + var ids = ''; | ||
278 | + if(data.length<=0){ | ||
279 | + layer.msg("请至少选择一条下载", { offset: '15px' , icon: 7 , time: 1500 }); | ||
280 | + }else if(data.length>=1){ | ||
281 | + var arr = []; | ||
282 | + $.each(data,function (i,e) { | ||
283 | + arr.push(e.id) | ||
284 | + }) | ||
285 | + ids = arr.toString(); | ||
286 | + var url = domainName + `/api-web/emergency/downloadWordZipforEmergency?accessToken=` + accessToken+"&ids="+ids+"&attachmentId="+ attachmentId+"&docType="+docType; | ||
287 | + window.open(url); | ||
269 | } | 288 | } |
270 | - var url = domainName + `/api-web/openoffice/download/${id}?accessToken=` + accessToken; | ||
271 | - window.open(url); | ||
272 | }) | 289 | }) |
273 | //新增/编辑表单 | 290 | //新增/编辑表单 |
274 | function openemergencyForm(id) { | 291 | function openemergencyForm(id) { |
@@ -173,7 +173,6 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | @@ -173,7 +173,6 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | ||
173 | //绑定业务下拉选择数据 | 173 | //绑定业务下拉选择数据 |
174 | common.bizTypeSelect("slt-biz-add", function () { | 174 | common.bizTypeSelect("slt-biz-add", function () { |
175 | form.render("select"); | 175 | form.render("select"); |
176 | - fromAssignment() | ||
177 | }); | 176 | }); |
178 | admin.req({ | 177 | admin.req({ |
179 | url: domainName + '/api-web/bWorkreportGroup/findManufacturerList' | 178 | url: domainName + '/api-web/bWorkreportGroup/findManufacturerList' |
@@ -185,7 +184,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | @@ -185,7 +184,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | ||
185 | options += "<option value='0'>其他</option>"; | 184 | options += "<option value='0'>其他</option>"; |
186 | $('#slt-emergencyadd-group').html(options); | 185 | $('#slt-emergencyadd-group').html(options); |
187 | form.render(); | 186 | form.render(); |
188 | - //fromAssignment(); | 187 | + fromAssignment(); |
189 | }); | 188 | }); |
190 | 189 | ||
191 | } | 190 | } |
@@ -356,7 +355,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | @@ -356,7 +355,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | ||
356 | // $('#add-repair-form').find("select[name='hitchtime']").attr("disabled", "disabled") | 355 | // $('#add-repair-form').find("select[name='hitchtime']").attr("disabled", "disabled") |
357 | // $('#add-repair-form').find("input[name='createtime']").attr("disabled", "disabled") | 356 | // $('#add-repair-form').find("input[name='createtime']").attr("disabled", "disabled") |
358 | //编辑表单时取消显示默认值 | 357 | //编辑表单时取消显示默认值 |
359 | - currentDate.config.isInitValue = false | 358 | + //currentDate.config.isInitValue = false |
360 | initDatePlus() | 359 | initDatePlus() |
361 | admin.req({ | 360 | admin.req({ |
362 | url: domainName + `/api-web/emergency/findBEmergencyRecordByRecordId`, | 361 | url: domainName + `/api-web/emergency/findBEmergencyRecordByRecordId`, |
@@ -177,15 +177,20 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat | @@ -177,15 +177,20 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat | ||
177 | //下载 | 177 | //下载 |
178 | $('#recoveryverify_download').on('click', function (){ | 178 | $('#recoveryverify_download').on('click', function (){ |
179 | var data = table.checkStatus('recoveryverify-table').data; | 179 | var data = table.checkStatus('recoveryverify-table').data; |
180 | + var attachmentId = '09f4988f2fc8a785700040c49cfe5d12'; | ||
181 | + var ids = ''; | ||
180 | if(data.length<=0){ | 182 | if(data.length<=0){ |
181 | - layer.msg("请选择一条作为下载模板", { offset: '15px' , icon: 7 , time: 1500 }); | ||
182 | - }else if(data.length>1){ | ||
183 | - layer.msg("请最多选择一条作为下载模板", { offset: '15px' , icon: 7 , time: 1500 }); | ||
184 | - }else { | ||
185 | - let attachmentId = '09f4988f2fc8a785700040c49cfe5d12'; | ||
186 | - var url = domainName + `/api-web/word/exportWord?accessToken=` + accessToken+"&attachmentId="+attachmentId+"&recoveryverifyId="+data[0].id; | 183 | + layer.msg("请至少选择一条下载", { offset: '15px' , icon: 7 , time: 1500 }); |
184 | + }else if(data.length>=1){ | ||
185 | + var arr = []; | ||
186 | + $.each(data,function (i,e) { | ||
187 | + arr.push(e.id) | ||
188 | + }) | ||
189 | + ids = arr.toString(); | ||
190 | + var url = domainName + `/api-web/recoveryverify/downloadWordZipforRecoveryverify?accessToken=` + accessToken+"&ids="+ids+"&attachmentId="+ attachmentId; | ||
187 | window.open(url); | 191 | window.open(url); |
188 | } | 192 | } |
193 | + | ||
189 | }) | 194 | }) |
190 | //新增/编辑表单 | 195 | //新增/编辑表单 |
191 | function openrecoveryverifyForm(id) { | 196 | function openrecoveryverifyForm(id) { |
@@ -86,7 +86,7 @@ | @@ -86,7 +86,7 @@ | ||
86 | <i class="layui-icon"></i>新增 | 86 | <i class="layui-icon"></i>新增 |
87 | </button> | 87 | </button> |
88 | <button class="layui-btn layui-btn-sm layui-btn-normal active" data-type="" id="emergency_download" > | 88 | <button class="layui-btn layui-btn-sm layui-btn-normal active" data-type="" id="emergency_download" > |
89 | - <i class="layui-icon"></i>模板下载 | 89 | + <i class="layui-icon"></i>下载 |
90 | </button> | 90 | </button> |
91 | <button class="layui-btn layui-btn-sm layui-btn-normal active" | 91 | <button class="layui-btn layui-btn-sm layui-btn-normal active" |
92 | id="emergency-export-excel"> | 92 | id="emergency-export-excel"> |
@@ -84,7 +84,7 @@ | @@ -84,7 +84,7 @@ | ||
84 | <i class="layui-icon"></i>新增 | 84 | <i class="layui-icon"></i>新增 |
85 | </button> | 85 | </button> |
86 | <button class="layui-btn layui-btn-sm layui-btn-normal active" data-type="" id="recoveryverify_download" > | 86 | <button class="layui-btn layui-btn-sm layui-btn-normal active" data-type="" id="recoveryverify_download" > |
87 | - <i class="layui-icon"></i>模板下载 | 87 | + <i class="layui-icon"></i>下载 |
88 | </button> | 88 | </button> |
89 | <button class="layui-btn layui-btn-sm layui-btn-normal active" | 89 | <button class="layui-btn layui-btn-sm layui-btn-normal active" |
90 | id="recoveryverify-export-excel"> | 90 | id="recoveryverify-export-excel"> |
-
Please register or login to post a comment