diff --git a/dist.zip b/dist.zip deleted file mode 100644 index 9a124de..0000000 Binary files a/dist.zip and /dev/null differ diff --git a/src/views/daily/deptindex.vue b/src/views/daily/deptindex.vue index 4979517..6d053ab 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,58 +43,60 @@ :page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total"> - - - - - - - - - - - - - - 点击上传 - - - - - - - - - - - - - - - - - - - - {{item.original_name}} - - - - - - - + + + + + + + + + + + + + + 点击上传 + + + + + + + + + + + + + + + + + + + + + {{item.original_name}} + + + + + + + + @@ -114,9 +116,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 { @@ -125,11 +127,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, @@ -137,8 +139,8 @@ }, show_self: 1, tableHeight: 0, - dialogFormVisible: false, - dialogShowViewVisible:false, + dialogFormVisible: false, + dialogShowViewVisible: false, formLabelWidth: "120px", clientHeight: 0, form: { @@ -230,14 +232,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, @@ -249,75 +251,77 @@ }).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 => { - let result = Object.assign(that.form, res); - // this.$set(that.form,res); + console.log("res", res); + let result = Object.assign(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; - console.log(this.form); + that.$forceUpdate() }).catch(error => { //reject(error) }) }, - edit(obj,isnew) { + edit(obj, isnew) { this.form = this.$options.data().form; - 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.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.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 { @@ -355,11 +359,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; }, }