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