刘翔宇-旅管家 4 years ago
parent d1a1cc28fc
commit b66b32af5f

Binary file not shown.

@ -21,7 +21,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div v-for="safe in scope.row.safety_task_departments" v-if="safe.departments.id==department_user_id"> <div v-for="safe in scope.row.safety_task_departments" v-if="safe.departments.id==department_user_id">
<div v-if="column.type=='status'"> <div v-if="column.type=='status'">
<div v-for="item in isStatus" v-if="safe.status==item.id"> <div v-for="item in isStatus" v-if="safe.status==item.id">
{{item.name}} {{item.name}}
</div> </div>
</div> </div>
@ -50,9 +50,9 @@
<el-scrollbar style="flex: 1"> <el-scrollbar style="flex: 1">
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth"> <el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
<el-form-item label="内容" prop="content"> <el-form-item label="内容" prop="content">
<div style="width: 99.9%;"> <div style="width: 99.9%;">
<tinymce v-model="form.content" :height="300" /> <tinymce v-model="form.content" :height="300" />
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="附件" prop="file_list"> <el-form-item label="附件" prop="file_list">
<el-upload class="upload-demo" :on-success="handlesuccess" :data="uploadOther" <el-upload class="upload-demo" :on-success="handlesuccess" :data="uploadOther"
@ -69,7 +69,7 @@
<el-button @click="resetForm('form')"> </el-button> <el-button @click="resetForm('form')"> </el-button>
<el-button type="primary" v-preventReClick @click="submitForm('form','1')"> </el-button> <el-button type="primary" v-preventReClick @click="submitForm('form','1')"> </el-button>
</div> </div>
<div slot="footer" class="dialog-footer" v-if="isReportSave"> <div slot="footer" class="dialog-footer" v-if="isReportSave">
<el-button @click="resetForm('form')"> </el-button> <el-button @click="resetForm('form')"> </el-button>
<el-button type="primary" v-preventReClick @click="submitForm('form','1')"> </el-button> <el-button type="primary" v-preventReClick @click="submitForm('form','1')"> </el-button>
<el-button type="primary" v-preventReClick @click="submitForm('form', '2')"> </el-button> <el-button type="primary" v-preventReClick @click="submitForm('form', '2')"> </el-button>
@ -77,23 +77,25 @@
</el-dialog> </el-dialog>
<el-dialog title="安全生产任务上报内容查看" :visible.sync="dialogShowViewVisible" fullscreen> <el-dialog title="安全生产任务上报内容查看" :visible.sync="dialogShowViewVisible" fullscreen>
<div class="dialogConcent" :style="{height:clientHeight+'px'}"> <div class="dialogConcent" :style="{height:clientHeight+'px'}">
<el-scrollbar style="flex: 1"> <el-scrollbar style="flex: 1">
<el-form :model="form" ref="form" label-position="right" :label-width="formLabelWidth"> <el-form :model="form" ref="form" label-position="right" :label-width="formLabelWidth">
<el-form-item label="内容" prop="content"> <el-form-item label="内容" prop="content">
<div style="width: 99.9%;" v-html="form.content"> <div style="width: 99.9%;" v-html="form.content">
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="附件" prop="files"> <el-form-item label="附件" prop="files">
<el-link v-for="item in form.files" target="_blank" :href="item.url" type="primary">{{item.original_name}}</el-link> <el-link v-for="item in form.files" target="_blank" :href="item.url" type="primary">
</el-form-item> {{item.original_name}}
</el-form> </el-link>
</el-scrollbar> </el-form-item>
</div> </el-form>
<div slot="footer" class="dialog-footer"> </el-scrollbar>
<el-button @click="resetForm('form')"> </el-button> </div>
</div> <div slot="footer" class="dialog-footer">
</el-dialog> <el-button @click="resetForm('form')"> </el-button>
</div>
</el-dialog>
</div> </div>
@ -126,10 +128,10 @@
}, },
data() { data() {
return { return {
isReportSave:false, isReportSave: false,
checkAll: false, checkAll: false,
isIndeterminate: true, isIndeterminate: true,
department_user_id:"", department_user_id: "",
paginations: { paginations: {
page: 1, page: 1,
page_size: 15, page_size: 15,
@ -138,7 +140,7 @@
show_self: 1, show_self: 1,
tableHeight: 0, tableHeight: 0,
dialogFormVisible: false, dialogFormVisible: false,
dialogShowViewVisible:false, dialogShowViewVisible: false,
formLabelWidth: "120px", formLabelWidth: "120px",
clientHeight: 0, clientHeight: 0,
form: { form: {
@ -232,12 +234,12 @@
}, },
load() { load() {
getInfo({ getInfo({
// token:this.uploadOther.token; // token:this.uploadOther.token;
}).then(response => { }).then(response => {
this.department_user_id = response.department_id this.department_user_id = response.department_id
}).catch(error => { }).catch(error => {
console.log(error) console.log(error)
reject(error) reject(error)
}); });
listtask({ listtask({
page: this.paginations.page, page: this.paginations.page,
@ -261,9 +263,10 @@
info(obj) { info(obj) {
var that = this; var that = this;
get(obj.id).then(res => { get(obj.id).then(res => {
console.log("res", res);
let result = Object.assign(that.form, res); let result = Object.assign(that.form, res);
// this.$set(that.form,res);
that.form = result; that.form = result;
console.log("form", result);
let _files = []; let _files = [];
for (var mod of result.files) { for (var mod of result.files) {
let m = Object.assign({}, mod); let m = Object.assign({}, mod);
@ -273,17 +276,18 @@
that.form.safety_task_department_id = result.id; that.form.safety_task_department_id = result.id;
that.form.safety_task_id = result.safety_task_id; that.form.safety_task_id = result.safety_task_id;
that.fileList = _files; that.fileList = _files;
console.log(this.form); that.$forceUpdate()
}).catch(error => { }).catch(error => {
//reject(error) //reject(error)
}) })
}, },
edit(obj,isnew) { edit(obj, isnew) {
this.form = this.$options.data().form; this.form = this.$options.data().form;
this.form.content = "";
this.form.file_list = [];
this.clientHeight = document.documentElement.clientHeight - 84 - 110; this.clientHeight = document.documentElement.clientHeight - 84 - 110;
if (isnew) { if (isnew) {
var that = this; var that = this;
that.form.content="";
that.info(obj); that.info(obj);
this.isReportSave = true; this.isReportSave = true;
} else { } else {
@ -300,7 +304,7 @@
var that = this; var that = this;
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
if(status=="2"){ if (status == "2") {
submitsave(that.form).then(response => { submitsave(that.form).then(response => {
//console.log(response) //console.log(response)
this.$Message.success('操作成功'); this.$Message.success('操作成功');
@ -309,7 +313,7 @@
}).catch(error => { }).catch(error => {
//reject(error) //reject(error)
}) })
}else{ } else {
save(that.form).then(response => { save(that.form).then(response => {
//console.log(response) //console.log(response)
this.$Message.success('操作成功'); this.$Message.success('操作成功');

Loading…
Cancel
Save