优化临时任务修改功能和上传下载模板功能

main
liukewei 11 months ago
parent c8789b982e
commit c27bea784a

@ -89,7 +89,16 @@ public class EhsNoticeMessageController extends BaseController
@GetMapping(value = "/{noticeMessageId}") @GetMapping(value = "/{noticeMessageId}")
public AjaxResult getInfo(@PathVariable("noticeMessageId") Long noticeMessageId) public AjaxResult getInfo(@PathVariable("noticeMessageId") Long noticeMessageId)
{ {
return success(ehsNoticeMessageService.selectEhsNoticeMessageByNoticeMessageId(noticeMessageId)); EhsNoticeMessage ehsNoticeMessage = ehsNoticeMessageService.selectEhsNoticeMessageByNoticeMessageId(noticeMessageId);
if(StringUtils.isNotEmpty(ehsNoticeMessage.getDeptList())){
String[] s =ehsNoticeMessage.getDeptList().split(",");
Long[] l = new Long[s.length];
for (int i =0;i<s.length;i++ ) {
l[i] = Long.parseLong(s[i]);
}
ehsNoticeMessage.setDeptListArray(l);
}
return success(ehsNoticeMessage);
} }
/** /**

@ -90,4 +90,6 @@ public class EhsNoticeMessage extends BaseEntity
@TableField(exist = false) @TableField(exist = false)
private String messageFileId; private String messageFileId;
@TableField(exist = false)
private Long[] deptListArray;
} }

@ -266,6 +266,11 @@
<el-link type="primary" @click="val => {assistDeptClick(val, scope.row);}" > {{(scope.row.assistDept=='' ||scope.row.assistDept==null)?"无协办单位": "显示协办单位" }} </el-link> <el-link type="primary" @click="val => {assistDeptClick(val, scope.row);}" > {{(scope.row.assistDept=='' ||scope.row.assistDept==null)?"无协办单位": "显示协办单位" }} </el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="整改情况" align="center" prop="status" >
<template slot-scope="scope">
<dict-tag :options="dict.type.hidden_danger_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="整改资金" align="center" prop="rectifyMoney" /> <el-table-column label="整改资金" align="center" prop="rectifyMoney" />
<el-table-column label="标签" align="center" prop="hiddenDangerLabel"> <el-table-column label="标签" align="center" prop="hiddenDangerLabel">
<template slot-scope="scope"> <template slot-scope="scope">
@ -551,7 +556,7 @@ import {listAllDept } from "@/api/system/dept";
import enterpriseSelect from "./enterpriseSelect" import enterpriseSelect from "./enterpriseSelect"
export default { export default {
name: "EhsHiddenDanger", name: "EhsHiddenDanger",
dicts: ['hidden_danger_type', 'hidden_danger_grade', 'hidden_danger_label', 'enterprise_type','enterprise_scale','economic_type','area_id'], dicts: ['hidden_danger_type', 'hidden_danger_grade', 'hidden_danger_label', 'enterprise_type','enterprise_scale','economic_type','area_id', "hidden_danger_status"],
components:{ enterpriseSelect }, components:{ enterpriseSelect },
data() { data() {
return { return {
@ -774,6 +779,7 @@ export default {
this.form = response.data; this.form = response.data;
/* this.form.hiddenDangerLabelArray.push("0"); /* this.form.hiddenDangerLabelArray.push("0");
this.form.hiddenDangerLabelArray.push("1");*/ this.form.hiddenDangerLabelArray.push("1");*/
console.log(this.form.hiddenDangerLabelArray);
this.open = true; this.open = true;
this.title = "修改隐患信息"; this.title = "修改隐患信息";
}); });
@ -878,10 +884,7 @@ export default {
this.$alert(row.assistDeptName, '协办单位', { this.$alert(row.assistDeptName, '协办单位', {
confirmButtonText: '确定', confirmButtonText: '确定',
callback: action => { callback: action => {
this.$message({
type: 'info',
message: `action: ${ action }`
});
} }
}); });
} }

@ -185,6 +185,11 @@
<el-link type="primary" @click="val => {assistDeptClick(val, scope.row);}" > {{(scope.row.assistDept=='' ||scope.row.assistDept==null)?"无协办单位": "显示协办单位" }} </el-link> <el-link type="primary" @click="val => {assistDeptClick(val, scope.row);}" > {{(scope.row.assistDept=='' ||scope.row.assistDept==null)?"无协办单位": "显示协办单位" }} </el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="整改情况" align="center" prop="status" >
<template slot-scope="scope">
<dict-tag :options="dict.type.hidden_danger_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="整改资金" align="center" prop="rectifyMoney" /> <el-table-column label="整改资金" align="center" prop="rectifyMoney" />
<el-table-column label="标签" align="center" prop="hiddenDangerLabel"> <el-table-column label="标签" align="center" prop="hiddenDangerLabel">
<template slot-scope="scope"> <template slot-scope="scope">
@ -212,7 +217,7 @@ import {listAllDept } from "@/api/system/dept";
import enterpriseSelect from "./enterpriseSelect" import enterpriseSelect from "./enterpriseSelect"
export default { export default {
name: "EhsHiddenDanger", name: "EhsHiddenDanger",
dicts: ['hidden_danger_type', 'hidden_danger_grade', 'hidden_danger_label', 'enterprise_type'], dicts: ['hidden_danger_type', 'hidden_danger_grade', 'hidden_danger_label', 'enterprise_type', "hidden_danger_status"],
components:{ enterpriseSelect }, components:{ enterpriseSelect },
data() { data() {
return { return {
@ -473,10 +478,7 @@ export default {
this.$alert(row.assistDeptName, '协办单位', { this.$alert(row.assistDeptName, '协办单位', {
confirmButtonText: '确定', confirmButtonText: '确定',
callback: action => { callback: action => {
this.$message({
type: 'info',
message: `action: ${ action }`
});
} }
}); });
} }

@ -69,7 +69,9 @@
</el-table-column> </el-table-column>
<el-table-column label="任务模板" align="center" prop="fileTempOriginalName" v-if ="taskShow" > <el-table-column label="任务模板" align="center" prop="fileTempOriginalName" v-if ="taskShow" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="primary" @click="downloadFile(scope.row)" > {{(scope.row.fileTempOriginalName=='' ||scope.row.fileTempOriginalName==null)?"": scope.row.fileTempOriginalName }} </el-link> <span v-for="(item, index) in (scope.row.fileTempName==null?'':scope.row.fileTempName).split(',')" :key="index" >
<el-link type="primary" @click="downloadFile(scope.row,index)" > {{(scope.row.fileTempOriginalName=='' ||scope.row.fileTempOriginalName==null)?"": scope.row.fileTempOriginalName.split(",")[index] }} </el-link>
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="发布状态" align="center" prop="status" > <el-table-column label="发布状态" align="center" prop="status" >
@ -145,10 +147,10 @@
<el-select v-model="form.deptList" multiple collapse-tags v-if = "deptShow" <el-select v-model="form.deptList" multiple collapse-tags v-if = "deptShow"
style="margin-left: 20px;" placeholder="请选择"> style="margin-left: 20px;" placeholder="请选择">
<el-option <el-option
v-for="dict in allDeptList" v-for="de in allDeptList"
:key="dict.deptId" :key="de.deptId"
:label="dict.deptName" :label="de.deptName"
:value="dict.deptId" :value="de.deptId"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -397,6 +399,14 @@ export default {
const noticeMessageId = row.noticeMessageId || this.ids const noticeMessageId = row.noticeMessageId || this.ids
getEhsNoticeMessage(noticeMessageId).then(response => { getEhsNoticeMessage(noticeMessageId).then(response => {
this.form = response.data; this.form = response.data;
if(this.form.allDept == 1){
this.allDeptCheck = true;
this.deptShow = false;
this.form.deptList = ""
}else{
this.form.deptList = this.form.deptList.split(",").map(Number);
console.log(this.form.deptList);
}
this.open = true; this.open = true;
this.title = "修改"; this.title = "修改";
}); });
@ -404,10 +414,8 @@ export default {
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if(this.form.fileTempName==null ||this.form.fileTempName==''){
this.$modal.alert("请选择模板文件");
return;
}
if (valid) { if (valid) {
let ad = this.allDeptCheck ==true ? 1:0; let ad = this.allDeptCheck ==true ? 1:0;
this.form.allDept = ad; this.form.allDept = ad;
@ -416,15 +424,26 @@ export default {
else else
this.form.deptList = ""; this.form.deptList = "";
// //
let fileTemp = this.form.fileTempName.split(","); if(this.taskShow == 1){
let oFile = []; if(this.form.fileTempName==null ||this.form.fileTempName==''){
for(let i=0;i<fileTemp.length ;i++){ this.$modal.alert("请选择模板文件");
let f = fileTemp[i].split("/"); return;
let f1 = f[f.length-1].split("_")[0]; }
let f2 = f[f.length-1].split(".")[1]; let fileTemp = this.form.fileTempName.split(",");
oFile.push(f1+"."+f2); let oFile = [];
for(let i=0;i<fileTemp.length ;i++){
let f = fileTemp[i].split("/");
let f1 = f[f.length-1].split("_");
let fName = [];
for(let j = 0 ;j< f1.length-1;j++){
fName.push(f1[j]);
}
let fLast = f1[f1.length-1].split(".")
let f2 =fName.join("_")+"."+ fLast[fLast.length-1];
oFile.push(f2);
}
this.form.fileTempOriginalName = oFile.join(",");
} }
this.form.fileTempOriginalName = oFile.join(",");
if (this.form.noticeMessageId != null) { if (this.form.noticeMessageId != null) {
updateEhsNoticeMessage(this.form).then(response => { updateEhsNoticeMessage(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
@ -495,8 +514,8 @@ export default {
this.loading = false; this.loading = false;
}) })
}, },
downloadFile(row){ downloadFile(row,index){
this.$download.saveAs(`${process.env.VUE_APP_BASE_API}${row.fileTempName}`,`${row.fileTempOriginalName}`); this.$download.saveAs(`${process.env.VUE_APP_BASE_API}${row.fileTempName.split(",")[index]}`,`${row.fileTempOriginalName.split(",")[index]}`);
}, },
downAllFile(){ downAllFile(){
let p = "/ehsNoticeMessageFile/ehsNoticeMessageFile/downloadlist/" + this.downaAllnoticeMessageId let p = "/ehsNoticeMessageFile/ehsNoticeMessageFile/downloadlist/" + this.downaAllnoticeMessageId

@ -77,7 +77,9 @@
<el-table-column label="标题" align="center" prop="title" /> <el-table-column label="标题" align="center" prop="title" />
<el-table-column label="任务模板" align="center" prop="fileTempOriginalName" v-if ="taskShow" > <el-table-column label="任务模板" align="center" prop="fileTempOriginalName" v-if ="taskShow" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="primary" @click="downloadFile(scope.row)" > {{(scope.row.fileTempOriginalName=='' ||scope.row.fileTempOriginalName==null)?"": scope.row.fileTempOriginalName }} </el-link> <span v-for="(item, index) in scope.row.fileTempName.split(',')" :key="index" >
<el-link type="primary" @click="downloadFile(scope.row,index)" > {{(scope.row.fileTempOriginalName=='' ||scope.row.fileTempOriginalName==null)?"": scope.row.fileTempOriginalName.split(",")[index] }} </el-link>
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="提交状态" align="center" prop="status" > <el-table-column label="提交状态" align="center" prop="status" >
@ -463,8 +465,8 @@ export default {
this.getList(); this.getList();
}); });
}, },
downloadFile(row){ downloadFile(row,index){
this.$download.saveAs(`${process.env.VUE_APP_BASE_API}${row.fileTempName}`,`${row.fileTempOriginalName}`); this.$download.saveAs(`${process.env.VUE_APP_BASE_API}${row.fileTempName.split(",")[index]}`,`${row.fileTempOriginalName.split(",")[index]}`);
}, },
downloadDeptFile(row){ downloadDeptFile(row){
this.$download.saveAs(`${process.env.VUE_APP_BASE_API}${row.fileName}`,`${row.originalName}`); this.$download.saveAs(`${process.env.VUE_APP_BASE_API}${row.fileName}`,`${row.originalName}`);

@ -177,11 +177,9 @@
prop="principalName" prop="principalName"
/> />
<el-table-column label="整改情况" align="center" prop="status" > <el-table-column label="整改情况" align="center" prop="status" >
<template slot-scope="scope"> <template slot-scope="scope">
<span> <dict-tag :options="dict.type.hidden_danger_status" :value="scope.row.status"/>
{{statusToStr(scope.row.status)}} </template>
</span>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -211,7 +209,7 @@
export default { export default {
name: "Index", name: "Index",
dicts: ["hidden_danger_grade", "hidden_danger_status","hidden_danger_type"], dicts: ["hidden_danger_grade", "hidden_danger_status","hidden_danger_type" ],
data() { data() {
return { return {
showSearch: true, showSearch: true,
@ -344,14 +342,14 @@
cancel() { cancel() {
this.open = false; this.open = false;
}, },
statusToStr(value) { /*statusToStr(value) {
if(value=="0") if(value=="0")
return "未整改" return "未整改"
else if(value=="10") else if(value=="10")
return "已整改" return "已整改"
else else
return "未知" return "未知"
}, },*/
}, },
}; };
</script> </script>

Loading…
Cancel
Save