master
lion 3 years ago
parent ab152ab5d1
commit f854236359

@ -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 = {};

@ -0,0 +1,116 @@
<template>
<div>
<Modal v-model="dialogVisible" title="详情" width='70%'>
<div class="itemWrap">
<template v-for="(item,index) in formInfo">
<template v-if='item.form_show==1'>
<template v-if="item.field!='uploads'">
<div class="itemField">
<span>{{item.name}}:</span>
<span>{{form[item.field]}}</span>
</div>
</template>
<template v-else>
<div class="itemField">
<span>{{item.name}}:</span>
<span v-if="typeof form['uploads_uploads_id_relation']==='object'">
<a style='color:red' target="_blank" :href="form['uploads_uploads_id_relation']['url']">{{form['uploads_uploads_id_relation']['original_name']}}</a>
</span>
<span v-if="typeof form['uploads_uploads_id_relation']==='array'">
<template v-for="(upload,index) in form['uploads_uploads_id_relation']">
<a style='color:red;width:100%' target="_blank" :href="upload.url">{{upload.original_name}}</a>
</template>
</span>
</div>
</template>
</template>
</template>
</div>
<template slot='footer'>
<Button size="large" @click="closeDia"></Button>
</template>
</Modal>
</div>
</template>
<script>
import {
show
} from "@/api/system/baseForm";
export default {
props: {
formInfo: {
type: Array,
default: ()=>[],
},
tableName: String,
},
data() {
return {
id: '',
dialogVisible: false,
form: {}
}
},
watch: {
dialogVisible(newval) {
if (newval) {
this.getDetail()
} else {
this.id = ''
this.form = {}
// this.formInfo = []
}
},
},
created() {},
methods: {
show() {
this.dialogVisible = true
},
closeDia(){
this.dialogVisible = false
},
setId(id) {
if (typeof id == "number") {
this.id = id;
} else {
console.error("error typeof id: " + typeof id);
}
},
async getDetail() {
const res = await show({
id: this.id,
table_name: this.tableName
});
this.form = res;
// uploads_uploads_id_relation
},
}
}
</script>
<style scoped>
.itemWrap {
display: flex;
flex-flow: wrap;
}
.itemWrap>div {
width: 50%;
padding: 5px 10px;
font-size: 18px;
}
.itemField span:first-child {
text-align: right;
margin-right: 10px;
width: 30%;
display: inline-block;
}
.itemField span:last-child{
width:60%;
display:inline-block;
vertical-align: top;
}
</style>

@ -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)
},
};
</script>

@ -180,8 +180,8 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>现居住地
</div>
<div class="xy-table-item-content">
<avue-input-map :params="mapparams" style="width: 300px;" placeholder="请选择地图" v-model="mapform"></avue-input-map>
<!-- <el-input v-model="form.reside" placeholder="请输入现居住地" clearable style="width: 300px;"></el-input> -->
<!-- <avue-input-map :params="mapparams" style="width: 300px;" placeholder="请选择地图" v-model="mapform"></avue-input-map> -->
<el-input v-model="form.reside" placeholder="请输入现居住地" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>

@ -16,6 +16,8 @@
<div style="width:100%" v-html='node.content'></div>
</div>
</avue-flow>
<showdialoger :table-name="tableName" :form-info="formDialoger" ref="showdialog">
</showdialoger>
</div>
</template>
@ -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 = `<div class="persons">${res.name}</div>`
let contents =
`<p>姓名:${res.name}</p><p>性别:${res.sex}</p><p>残疾类别:${res.disabilitytype}</p><p>残疾等级:${res?.disabilitylevel}</p><p>现居住地:${res.reside}</p>`
`<div class='workhover' onclick="goUrls(${res.id},'records')"><p>姓名:${res.name}</p><p>性别:${res.sex}</p><p>联系方式:${res.mobile}</p><p>残疾类别:${res.disabilitytype}</p><p>残疾等级:${res?.disabilitylevel}</p><p>现居住地:${res.reside}</p></div>`
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 += `<p>${k.viewtime?.substring(0,10)}/${k.viewscene}<p>`
views += `<div class='workhover' onclick="goUrls(${k.id},'viewrecords')"><p>${k.viewtime?.substring(0,10)}/${k.viewscene}<p></div>`
}
}
}
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 +=`<div class='workhover' onclick="goUrls('${this.urlList[u]}','${res.idcard}')">`
workflows += `<div class='workhover' onclick="goUrls(${k.detail.id},'${u}')">`
}
}
if (k.guanlianbiao == 'assists') {
workflows += `<p>${k.created_at?.substring(0,10)}/${k.guanlianbiaoming}<p>`
workflows += `<p>${k.created_at?.substring(0,10)}/${k.guanlianbiaoming}<p>`
workflows += `<p>申请年限:${k.detail.shenqingnianxian}<p>`
workflows += `<p>管理年限:${k.detail.guanlinianxian}<p>`
workflows += `<p>辅具类别:${k.detail.sub_type}<p>`
@ -149,7 +204,7 @@
} else {
workflows += `<p>${k.created_at?.substring(0,10)}/${k.guanlianbiaoming}<p>`
}
workflows += "</div>"
}
}
}
@ -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 @@
</script>
<style scoped>
.curvedarrow {
position: relative;
width: 0;
border-top: 30px solid transparent;
border-right: 30px solid #147d38;
.curvedarrow {
position: relative;
width: 0;
border-top: 30px solid transparent;
border-right: 30px solid #147d38;
}
.curvedarrow:after{
content: "";
position: absolute;
border: 0 solid transparent;
border-top: 10px solid #147d38;
border-radius: 100px 0 0 0;
top: -94px;
left: -167px;
width: 182px;
height: 99px;
.curvedarrow:after {
content: "";
position: absolute;
border: 0 solid transparent;
border-top: 10px solid #147d38;
border-radius: 100px 0 0 0;
top: -94px;
left: -167px;
width: 182px;
height: 99px;
}
.curvedarrow-upleft {
position: relative;
left: 483px;
@ -239,9 +335,19 @@
.curvedarrow-bottomright:after {
transform: rotate(45deg);
}
/deep/ .avue-flow{
margin-top:-120px
/deep/ .workhover {
cursor: pointer;
}
/deep/ .workhover:hover {
color: #147d38
}
/deep/ .avue-flow {
margin-top: -120px
}
/deep/ .avue-grid {
background-image: none;
}

Loading…
Cancel
Save