diff --git a/src/views/component/dialog.vue b/src/views/component/dialog.vue index 45e6b68..46824d2 100644 --- a/src/views/component/dialog.vue +++ b/src/views/component/dialog.vue @@ -98,7 +98,7 @@ export default { // this.form = Object.assign({}, this.form); }else{ this.form[i.field] = e; - + } this.form = Object.assign({}, this.form); }, @@ -219,7 +219,6 @@ this.form = Object.assign({}, this.form); this.$refs.recordModal.isShow = true }, getRecordInfo(e){ - console.log(e) for(var k in e){ for(var m in this.form){ if(m == k){ @@ -333,6 +332,7 @@ this.form = Object.assign({}, this.form); }); }; } + // console.log(info.field,props) return props; }, @@ -347,7 +347,12 @@ this.form = Object.assign({}, this.form); this.$refs["elForm"].clearValidate(); }, show() { - this.dialogVisible = true; + if(this.type==='editor'){ + this.getDetail() + }else{ + this.dialogVisible = true; + } + }, hidden() { this.dialogVisible = false; @@ -372,21 +377,32 @@ this.form = Object.assign({}, this.form); const res = await show({ id: this.id, table_name: this.tableName }); this.$integrateData(this.form, res); this.form = Object.assign({}, this.form); - console.log("formInfo",this.formInfo) this.formInfo.forEach((i) => { if (i && i.edit_input === "file") { - if(res[i._relations.link_with_name]){ + if(res[i.field+'_uploads_id_relation']){ this.file[i.field] = [ { - name: res[i._relations.link_with_name]?.original_name, - url: res[i._relations.link_with_name]?.url, - response: res[i._relations.link_with_name], + name: res[i.field+'_uploads_id_relation']?.original_name, + url: res[i.field+'_uploads_id_relation']?.url, + response: res[i.field+'_uploads_id_relation'], }, ]; } - + } + if (i && i.edit_input === "files") { + if(res[i.field+'_upload_details']){ + this.file[i.field] = [] + for(var k of res[i.field+'_upload_details']){ + this.file[i.field].push({ + name: k?.original_name, + url: k?.url, + response: k, + }) + } + } } }); + this.dialogVisible = true; }, submit() { @@ -407,19 +423,27 @@ this.form = Object.assign({}, this.form); if (validate) { this.formInfo.forEach((info) => { if (info.edit_input === "files") { - this.form[info.field] = info._fileList.map( + console.log("info",info) + console.log("this.file[info.field]",this.file[info.field]) + this.form[info.field] = this.file[info.field].map( (i) => i?.response?.id ); } if (info.edit_input === "file") { if(this.file[info.field]){ - this.form[info.field] = this.file[info.field][0]?.response?.id; + // this.form[info.field] = this.file[info.field][0]?.response?.id; + this.$set(this.form,info.field,this.file[info.field][0]?this.file[info.field][0].response.id:'') } - } }); - console.log(this.form); - save(Object.assign(this.form, { table_name: this.tableName })).then( + + // return + // this.form.uploads = '' + save({ + table_name: this.tableName, + ...this.form + // Object.assign(this.form, { table_name: this.tableName }) + }).then( (res) => { this.$Message.success({ content: `${this.type === "add" ? "新增" : "编辑"}成功`, @@ -472,7 +496,7 @@ this.form = Object.assign({}, this.form); dialogVisible(val) { if (val) { if (this.type === "editor") { - this.$nextTick(() => this.getDetail()); + // this.$nextTick(() => this.getDetail()); } } else { this.file = {}; diff --git a/src/views/component/showdialog.vue b/src/views/component/showdialog.vue new file mode 100644 index 0000000..e1635b0 --- /dev/null +++ b/src/views/component/showdialog.vue @@ -0,0 +1,116 @@ + + + diff --git a/src/views/component/table.vue b/src/views/component/table.vue index 63a0c92..201c27d 100644 --- a/src/views/component/table.vue +++ b/src/views/component/table.vue @@ -591,7 +591,16 @@ export default { } }, created() { + let idcard = this.$route.query.idcard + if(idcard){ + this.select.filter[0] = { + key: "idcard", + op: "eq", + value: idcard, + }; + } this.getFormDetail(); + console.log(this.$route.query.idcard) }, }; diff --git a/src/views/record/components/addRecord.vue b/src/views/record/components/addRecord.vue index 979b2d0..d62d394 100644 --- a/src/views/record/components/addRecord.vue +++ b/src/views/record/components/addRecord.vue @@ -180,8 +180,8 @@ *现居住地:
- - + +
diff --git a/src/views/record/personinfo.vue b/src/views/record/personinfo.vue index c35396e..200a4ec 100644 --- a/src/views/record/personinfo.vue +++ b/src/views/record/personinfo.vue @@ -16,6 +16,8 @@
+ + @@ -23,19 +25,51 @@ import { show } from "@/api/system/baseForm.js" + import { + index as getcustomForm, + show as showcustomForm + } from "@/api/system/customForm"; import { getSsttIndex } from "@/api/sstt" import { Message } from 'element-ui' + import showdialoger from "@/views/component/showdialog.vue"; + export default { + components: { + showdialoger + }, data() { return { count: 0, form: '', mapHeight: 0, idcard: '', + tableName: '', + recordId:"", + viewRecordId:"", + allTable:[], + formDialoger: [], + urlList: { + fuels: '/book_cars', + reforms: '/book_reform', + medicines: '/book_drug', + childrens: '/book_children', + assists: '/book_help', + communities: '/book_health', + educations: '/book_education', + raises: '/book_raise', + starts_addresses: '/book_address', + starts_subsidys: '/book_starts', + doubles: "/book_double", + disabilities: '/book_number', + trains: '/book_train', + insures: '/book_insure', + cancels: '/book_cancel', + jobs: '/book_job' + }, option: { "name": "视图", "nodeList": [{ @@ -73,36 +107,49 @@ "content": '' } ], - // "lineList": [{ - // "from": "all", - // "to": "person" - // }, - // { - // "from": "all", - // "to": "business" - // }, - // { - // "from": "all", - // "to": "view" - // }, - // { - // "from": "all", - // "to": "raises" - // } - // ] + "lineList": [ + // { + // "from": "all", + // "to": "person" + // }, + // { + // "from": "all", + // "to": "business" + // }, + // { + // "from": "all", + // "to": "view" + // }, + // { + // "from": "all", + // "to": "raises" + // } + ] } } }, mounted() { - this.initHeight() + this.initHeight() + this.getAllTable() // this.form = this.nodeList[this.count].id; this.getPerson() + let that = this + window.goUrls = function(e,table) { + that.goUrl(e,table) + } }, methods: { initHeight() { let winHeight = document.body.clientHeight this.mapHeight = winHeight - 50 - 20 - console.log(winHeight) + }, + goUrl(e,table) { + this.tableName = table + for(var k of this.allTable){ + if(table==k.table_name){ + this.getFormDetail(e,k.id) + } + } }, getPerson() { if (this.$route.query?.id) { @@ -122,24 +169,32 @@ }) let names = `
${res.name}
` let contents = - `

姓名:${res.name}

性别:${res.sex}

残疾类别:${res.disabilitytype}

残疾等级:${res?.disabilitylevel}

现居住地:${res.reside}

` + `

姓名:${res.name}

性别:${res.sex}

联系方式:${res.mobile}

残疾类别:${res.disabilitytype}

残疾等级:${res?.disabilitylevel}

现居住地:${res.reside}

` let views = '' let workflows = '' this.idcard = res.idcard if (res.idcard_viewrecords_idcard_relation.length > 0) { for (var k of res.idcard_viewrecords_idcard_relation) { if (k.checkstatus == '通过') { - views += `

${k.viewtime?.substring(0,10)}/${k.viewscene}

` + views += `

${k.viewtime?.substring(0,10)}/${k.viewscene}

` } } } if (res.idcard_workflows_idcard_relation.length > 0) { for (var k of res.idcard_workflows_idcard_relation) { - if (k.work_status == '通过') { // 辅具适配 + + for (var u in this.urlList) { + if (k.guanlianbiao == u) { + // this.tableName = u + // workflows +=`
` + workflows += `
` + } + } + if (k.guanlianbiao == 'assists') { - workflows += `

${k.created_at?.substring(0,10)}/${k.guanlianbiaoming}

` + workflows += `

${k.created_at?.substring(0,10)}/${k.guanlianbiaoming}

` workflows += `

申请年限:${k.detail.shenqingnianxian}

` workflows += `

管理年限:${k.detail.guanlinianxian}

` workflows += `

辅具类别:${k.detail.sub_type}

` @@ -149,7 +204,7 @@ } else { workflows += `

${k.created_at?.substring(0,10)}/${k.guanlianbiaoming}

` } - + workflows += "

" } } } @@ -172,7 +227,46 @@ } this.option['nodeList'][4]['content'] = raises }) - } + }, + // 获取所有业务表 + async getAllTable(){ + const res = await getcustomForm({ + page: 1, + page_size: 999 + }) + this.allTable = res.data + }, + // 获取点击的业务表字段 + async getFormDetail(e,tableId) { + const res = await showcustomForm({ + id: tableId + }); + // this.title = res.name; + //字段处理 + let { + fields, + relation + } = res; + if ( + !fields || + !relation || + !fields instanceof Array || + !relation instanceof Array + ) { + throw new Error("fields或relation格式错误"); + } + this.formDialoger = fields.sort(this.handle('sort')); + this.$refs['showdialog'].setId(e); + this.$refs['showdialog'].show(); + }, + handle(property) { + return function(a, b) { + const val1 = a[property]; + const val2 = b[property]; + return val1 - val2; + } + }, + } @@ -181,23 +275,25 @@