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 @@
+
+
姓名:${res.name}
性别:${res.sex}
残疾类别:${res.disabilitytype}
残疾等级:${res?.disabilitylevel}
现居住地:${res.reside}
` + `姓名:${res.name}
性别:${res.sex}
联系方式:${res.mobile}
残疾类别:${res.disabilitytype}
残疾等级:${res?.disabilitylevel}
现居住地:${res.reside}
${k.viewtime?.substring(0,10)}/${k.viewscene}
` + views += `
${k.viewtime?.substring(0,10)}/${k.viewscene}
${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 += "