diff --git a/src/views/daily/deptindex.vue b/src/views/daily/deptindex.vue index 6d053ab..4979517 100644 --- a/src/views/daily/deptindex.vue +++ b/src/views/daily/deptindex.vue @@ -18,22 +18,22 @@ - - - - - {{item.name}} - - - - 新增上报 - 编辑上报 - 查看上报 - - {{scope.row[column.field]}} + + + + + {{item.name}} + + + + 新增上报 + 编辑上报 + 查看上报 + + {{scope.row[column.field]}} @@ -43,60 +43,58 @@ :page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total"> - - - - - - - - - - - - - - 点击上传 - - - - - - - - - - - - - - - - - - - - - {{item.original_name}} - - - - - - - - + + + + + + + + + + + + + + 点击上传 + + + + + + + + + + + + + + + + + + + + {{item.original_name}} + + + + + + + @@ -116,9 +114,9 @@ } from "../../api/daily/deptindex.js"; import { listtask - } from "../../api/daily/index.js"; - import { - getInfo + } from "../../api/daily/index.js"; + import { + getInfo } from "../../api/user.js"; export default { @@ -127,11 +125,11 @@ Tinymce }, data() { - return { - isReportSave: false, + return { + isReportSave:false, checkAll: false, - isIndeterminate: true, - department_user_id: "", + isIndeterminate: true, + department_user_id:"", paginations: { page: 1, page_size: 15, @@ -139,8 +137,8 @@ }, show_self: 1, tableHeight: 0, - dialogFormVisible: false, - dialogShowViewVisible: false, + dialogFormVisible: false, + dialogShowViewVisible:false, formLabelWidth: "120px", clientHeight: 0, form: { @@ -232,14 +230,14 @@ this.paginations.page = page; this.load(); }, - load() { - getInfo({ - // token:this.uploadOther.token; - }).then(response => { - this.department_user_id = response.department_id - }).catch(error => { - console.log(error) - reject(error) + load() { + getInfo({ + // token:this.uploadOther.token; + }).then(response => { + this.department_user_id = response.department_id + }).catch(error => { + console.log(error) + reject(error) }); listtask({ page: this.paginations.page, @@ -251,77 +249,75 @@ }).catch(error => { console.log(error) reject(error) - }); + }); }, show(obj) { this.clientHeight = document.documentElement.clientHeight - 84 - 110; - this.dialogViewVisible = false; + this.dialogViewVisible = false; this.dialogShowViewVisible = true; this.info(obj); }, info(obj) { var that = this; 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; - console.log("form", result); let _files = []; for (var mod of result.files) { let m = Object.assign({}, mod); m.name = mod.original_name; _files.push(m); - } - 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.fileList = _files; - that.$forceUpdate() + console.log(this.form); }).catch(error => { //reject(error) }) }, - edit(obj, isnew) { + edit(obj,isnew) { this.form = this.$options.data().form; - this.form.content = ""; - this.form.file_list = []; - this.clientHeight = document.documentElement.clientHeight - 84 - 110; - if (isnew) { - var that = this; - that.info(obj); - this.isReportSave = true; - } else { - this.clientHeight = document.documentElement.clientHeight - 84 - 110; - this.form.safety_task_id = obj.id; - this.isReportSave = false; - } + this.clientHeight = document.documentElement.clientHeight - 84 - 110; + if (isnew) { + var that = this; + that.form.content=""; + that.info(obj); + this.isReportSave = true; + } else { + this.clientHeight = document.documentElement.clientHeight - 84 - 110; + this.form.safety_task_id = obj.id; + this.isReportSave = false; + } this.dialogFormVisible = true; - }, - editSave(obj) { - + }, + editSave(obj) { + }, submitForm(formName, status) { var that = this; this.$refs[formName].validate((valid) => { - if (valid) { - if (status == "2") { - submitsave(that.form).then(response => { - //console.log(response) - this.$Message.success('操作成功'); - that.load(); - that.dialogFormVisible = false; - }).catch(error => { - //reject(error) - }) - } else { - save(that.form).then(response => { - //console.log(response) - this.$Message.success('操作成功'); - that.load(); - that.dialogFormVisible = false; - }).catch(error => { - //reject(error) - }) + if (valid) { + if(status=="2"){ + submitsave(that.form).then(response => { + //console.log(response) + this.$Message.success('操作成功'); + that.load(); + that.dialogFormVisible = false; + }).catch(error => { + //reject(error) + }) + }else{ + save(that.form).then(response => { + //console.log(response) + this.$Message.success('操作成功'); + that.load(); + that.dialogFormVisible = false; + }).catch(error => { + //reject(error) + }) } that.fileList = []; } else { @@ -359,11 +355,11 @@ this.form.file_list = listUrl; }, resetForm(formName) { - var that = this; + var that = this; that.fileList = []; this.$refs[formName].resetFields(); - that.dialogFormVisible = false; - that.dialogShowViewVisible = false; + that.dialogFormVisible = false; + that.dialogShowViewVisible = false; }, }