Commit bf2f1af3 by 叶富雄

设置页面

parent f700d769
<template>
<div>
<form-compontent
:formField="propFormField"
:formLabelAligns="formLabelAlign"
@submit="submit"
:propTitle="title"
@handleRemove="handleRemove"
pageBs="addsqfbzl"
ref="formCompontent"
>
</form-compontent>
</div>
</template>
<script>
import formCompontent from "@c/form.vue";
import { updateRyxx} from "@/api/dswtzxx.js";
import {
insertDna,
selectDnaList
} from "@/api/dswtz/dnaxx.js";
export default {
name: "addryxx",
components: {
formCompontent,
},
data() {
return {
title: "新增人员信息",
propFormField: [
{
title: "",
id: 1,
objStr: "",
index: 0,
data: [
{
name: "姓名:",
id: "xm",
type: "text",
value: "",
placeholder: "请输入",
col: "2",
},
{
name: "公民身份号码:",
id: "gmsfhm",
type: "dates",
value: "",
placeholder: "请输入",
col: "2",
},
{
name: "DNA编号:",
id: "rydnabh",
type: "dates",
value: "",
placeholder: "请输入",
col: "2",
},
{
name: "样本类型:",
id: "yblxdm",
type: "codeTree",
codeTree: "CODE_YTHCJ_DNAYBLX",
codeOptions: [],
value: "",
placeholder: "请输入",
col: "2",
},
],
},
],
formLabelAlign: {},
type: "",
xxzjbh: "",
result: "",
removeFileXxzjbh: [],
};
},
methods: {
submit(params) {
params.append('rybh',this.rybh)
insertDna(params)
},
handleRemove(val) {
console.log(val);
this.removeFileXxzjbh.push(val.xxzjbh);
},
getshuju() {
let loading = this.$loading({
lock: true,
text: "正在加载...",
spinner: "el-icon-loading",
background: "rgba(255, 255, 255, 0.7)",
});
var self = this;
let params = new FormData();
params.append("rybh", this.rybh);
selectDnaList(params).then((res) => {
var result = res.data.rows;
this.result = result;
self.propFormField.forEach((fieldItem) => {
if (fieldItem.data && fieldItem.data.length > 0) {
fieldItem.data.forEach((i) => {
this.$set(this.formLabelAlign, i.id, result[i.id]);
});
}
this.$forceUpdate();
});
self.$set(self.formLabelAlign, "editing", true);
self.$forceUpdate();
setTimeout(() => {
loading.close();
}, 500);
});
},
},
created() {
if (this.$route.query.rybh) {
this.title = "DNA信息管理";
this.rybh = this.$route.query.rybh;
this.getshuju();
}
},
};
</script>
<style scoped lang="scss">
</style>
<template>
<div>
<form-compontent
:formField="propFormField"
:formLabelAligns="formLabelAlign"
@submit="submit"
:propTitle="title"
@handleRemove="handleRemove"
pageBs="addsqfbzl"
ref="formCompontent"
>
</form-compontent>
</div>
</template>
<script>
import formCompontent from "@c/form.vue";
import { updateHm} from "@/api/dswtz/hmxx.js";
import {
selectDnaList
} from "@/api/dswtz/dnaxx.js";
export default {
name: "addryxx",
components: {
formCompontent,
},
data() {
return {
title: "新增虹膜信息",
propFormField: [
{
title: "",
id: 1,
objStr: "",
index: 0,
data: [
{
name: "姓名:",
id: "xm",
type: "text",
value: "",
placeholder: "请输入",
col: "2",
},
{
name: "公民身份号码:",
id: "gmsfhm",
type: "text",
value: "",
placeholder: "请输入",
col: "2",
},
{
name: "左虹膜:",
id: "hmsjLeft",
type: "file",
value: "",
placeholder: "请输入",
col: "22",
},
{
name: "右虹膜:",
id: "hmsjRight",
type: "file",
value: "",
placeholder: "请输入",
col: "22",
},
],
},
],
formLabelAlign: {},
type: "",
xxzjbh: "",
result: "",
removeFileXxzjbh: [],
};
},
methods: {
submit(params) {
params.append('rybh',this.rybh)
updateHm(params)
},
handleRemove(val) {
console.log(val);
this.removeFileXxzjbh.push(val.xxzjbh);
},
getshuju() {
let loading = this.$loading({
lock: true,
text: "正在加载...",
spinner: "el-icon-loading",
background: "rgba(255, 255, 255, 0.7)",
});
var self = this;
let params = new FormData();
params.append("rybh", this.rybh);
selectDnaList(params).then((res) => {
var result = res.data.rows;
this.result = result;
self.propFormField.forEach((fieldItem) => {
if (fieldItem.data && fieldItem.data.length > 0) {
fieldItem.data.forEach((i) => {
this.$set(this.formLabelAlign, i.id, result[i.id]);
});
}
this.$forceUpdate();
});
self.$set(self.formLabelAlign, "editing", true);
self.$forceUpdate();
setTimeout(() => {
loading.close();
}, 500);
});
},
},
created() {
if (this.$route.query.rybh) {
this.title = "虹膜信息管理";
this.rybh = this.$route.query.rybh;
this.getshuju();
}
},
};
</script>
<style scoped lang="scss">
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment