|
|
@ -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
|
|
|
|