diff --git a/src/api/system/dictionary.js b/src/api/system/dictionary.js index 0519f9a..2061685 100644 --- a/src/api/system/dictionary.js +++ b/src/api/system/dictionary.js @@ -21,6 +21,17 @@ export function getparameter(param) { method: 'get', params: param }) +} + +export function getparameteritem(number) { + + return request({ + url: '/api/admin/parameter/show', + method: 'get', + params: { + number: number + } + }) } export function listparameter(param) { diff --git a/src/views/common/index.vue b/src/views/common/index.vue index f2a246a..8ec98a6 100644 --- a/src/views/common/index.vue +++ b/src/views/common/index.vue @@ -35,6 +35,16 @@
已审核
已办结
+
+
+ {{item.name}} +
+
+
+
+ {{item.value}} +
+
{{scope.row[column.field]}}
@@ -48,26 +58,27 @@
- - - + + - - - - + + --> - - - - + + --> @@ -75,9 +86,6 @@ - - - @@ -93,7 +101,7 @@ - + @@ -103,8 +111,8 @@ - - + + @@ -131,7 +139,14 @@ update, save, del - } from '../../api/commonInspection/index.js' + } from '../../api/commonInspection/index.js' + import { + listdept + } from "../../api/system/department.js" + import { + getparameteritem, + getparameter + } from "../../api/system/dictionary.js" import LxHeader from "@/components/LxHeader/index.vue"; export default { @@ -145,16 +160,7 @@ dialogFormVisible: false, formLabelWidth: "120px", clientHeight: 0, - tableData: [{ - feedback_department_id:"", - ask_type_id:"", - ask_content_id:"", - content:"", - longitude:"", - latitude:"", - address:"", - status:1} - ], + tableData: [], tableHeight: 900, searchFields: { KeyWord: "" @@ -163,6 +169,15 @@ page: 1, page_size: 15, total: 0 + }, + selects:{ + ask_types:[], + ask_content:[], + departments:[] + }, + formdetail:{ + ask_type_detail:"", + ask_content_detail:"", }, form: { feedback_department_id:"", @@ -182,13 +197,12 @@ columns: [{ field: "feedback_department_id", title: "反馈科室", - type: "string" + type: "feedback_department_id" }, - { field: "ask_type_id", title: "类型", - type: "string", + type: "ask_type_id", align: "center" }, { @@ -210,22 +224,23 @@ align: "center" }, { - field: "person", + field: "username", title: "提交人", - type: "string", + type: "user", align: "center" }, { - field: "parimary", + field: "department_id", title: "提交科室", type: "string", align: "center" }, { - field: "date", + field: "created_at", title: "提交日期", type: "string", - align: "center" + align: "center", + width:200 }, { field: "操作", @@ -266,7 +281,17 @@ var paginationHeight = 37; //分页的高度 var topHeight = 50; //页面 头部 let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20; - that.tableHeight = tableHeight; + that.tableHeight = tableHeight; + + getparameteritem("general_type").then(res => { + this.selects.ask_types = res.detail + }) + + listdept().then(res => { + this.selects.departments = res + }) + + }, handleCurrentChange(page) { this.paginations.page = page; @@ -278,8 +303,11 @@ page: this.paginations.page, page_size: this.paginations.page_size, keyword: this.searchFields.KeyWord - }).then(response => { - // this.tableData = response.data; + }).then(response => { + for(var m of response.data){ + m.username = m.user.name + } + this.tableData = response.data; this.paginations.total = response.total; }).catch(error => { console.log(error) @@ -297,15 +325,19 @@ var that = this; get(obj.id).then(res => { let result = Object.assign(that.form, res); - // this.$set(that.form,res); - that.form = result; - let _files = []; - for (var mod of result.files) { - let m = Object.assign({}, mod); - m.name = mod.original_name; - _files.push(m); - } - that.fileList = _files; + // this.$set(that.form,res); + // showAskContent(result.ask_type_id); + // that.form = result; + that.formdetail = result; + console.log(that.formdetail); + + // let _files = []; + // for (var mod of result.files) { + // let m = Object.assign({}, mod); + // m.name = mod.original_name; + // _files.push(m); + // } + // that.fileList = _files; }).catch(error => { //reject(error) }) @@ -313,17 +345,20 @@ 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.clientHeight = document.documentElement.clientHeight - 84 - 110; + if(obj){ + this.info(obj); } + // 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; }, @@ -382,11 +417,18 @@ }, resetForm(formName) { var that = this; - that.fileList = []; - this.$refs[formName].resetFields(); + // that.fileList = []; + // this.$refs[formName].resetFields(); that.dialogFormVisible = false; that.dialogShowViewVisible = false; + }, + showAskContent(val){ + getparameter({ + pid:val + }).then(res =>{ + this.selects.ask_content = res.detail + }) }, handleRemove(file, fileList) { console.log(fileList);