Commit d2a678ee authored by 刘予佳's avatar 刘予佳

Merge remote-tracking branch 'remotes/origin/dev_Miaojiale' into dev_lyj

parents 22303057 e3d195a6
...@@ -433,6 +433,7 @@ export default { ...@@ -433,6 +433,7 @@ export default {
return { return {
pickerOptions, pickerOptions,
rangeOptions, rangeOptions,
showChildren: false, // 用来控制不同表单
} }
}, },
computed: { computed: {
...@@ -624,10 +625,10 @@ export default { ...@@ -624,10 +625,10 @@ export default {
this.$watch( this.$watch(
`form.${prop}`, `form.${prop}`,
function (val) { function (val) {
//! val 表单的当前属性值
const columns = this.columns || [] const columns = this.columns || []
const group = this.group || [] const group = this.group || []
const dyMap = {} // 显示数据集合 const dyMap = {} //! 显示数据集合
dynamicshSet.forEach((dy) => { dynamicshSet.forEach((dy) => {
if (dyMap[dy.target]) { if (dyMap[dy.target]) {
dyMap[dy.target].push(dy.value) dyMap[dy.target].push(dy.value)
...@@ -635,10 +636,11 @@ export default { ...@@ -635,10 +636,11 @@ export default {
dyMap[dy.target] = [dy.value] dyMap[dy.target] = [dy.value]
} }
}) })
Object.keys(dyMap).forEach((key) => { Object.keys(dyMap).forEach((key) => {
// !获取显隐目标
let targetItem = columns.find((_) => _.prop === key) let targetItem = columns.find((_) => _.prop === key)
if (!targetItem) { if (!targetItem) {
// !没有在表单子组件中找到,查找大表单id
targetItem = group.find((_) => _.prop === key) targetItem = group.find((_) => _.prop === key)
} }
if (!targetItem) return if (!targetItem) return
...@@ -680,6 +682,7 @@ export default { ...@@ -680,6 +682,7 @@ export default {
} else { } else {
display = values.includes(val) display = values.includes(val)
} }
if (!display && targetItem) { if (!display && targetItem) {
// 清空数据 // 清空数据
const newVal = Array.isArray(this.form[targetItem.prop]) const newVal = Array.isArray(this.form[targetItem.prop])
...@@ -695,35 +698,91 @@ export default { ...@@ -695,35 +698,91 @@ export default {
this.$set(this.form, "$_hidden" + targetItem.prop, !display) this.$set(this.form, "$_hidden" + targetItem.prop, !display)
}, 200) }, 200)
} else { } else {
// 家族史动态规则 // ! 设置每个表单中每项显隐的rules
if (targetItem.rules && Boolean(display)) {
if ( console.log(targetItem)
(prop == "is_first_degree" || prop == "is_other_sickness") && if (targetItem.type == "checkbox") {
Boolean(display) targetItem.rules = [
) { {
targetItem.rules = [ required: true,
{ message: "请选择" + targetItem.label,
required: true, },
message: "请输入" + targetItem.label, ]
}, } else {
] targetItem.rules = [
} else if ( {
prop == "is_first_degree" || required: true,
prop == "is_other_sickness" message: "请输入" + targetItem.label,
) { },
this.$nextTick(() => { ]
targetItem.rules = []
})
}
// 内镜报告动态上传
if (prop == "check_type" && Boolean(display)) {
targetItem.rules[0] = {
required: true,
message: "请上传内镜报告",
} }
} else if (prop == "check_type") { } else if (targetItem.rules && !Boolean(display)) {
targetItem.rules = [] targetItem.rules = []
} }
// !设置大表单里的每个小表单显隐rules
if (targetItem.prop == "1669874397313_56690") {
console.log(targetItem.column)
// !只能写死,当前情况下,定义一个字段用来缓存是否回显,根据val
// if (val == 0) {
// this.showChildren = false
targetItem.column.forEach((e, index) => {
// 去除esd报告
if (e.prop == "esd_path") {
return
}
if (e.rules && val == 0) {
targetItem.column[index].rules = []
} else if (e.rules && val == 1) {
if (targetItem.column[index].type == "checkbox") {
targetItem.column[index].rules = [
{
required: true,
message: "请选择" + targetItem.column[index].label,
},
]
} else {
targetItem.column[index].rules = [
{
required: true,
message: "请输入" + targetItem.column[index].label,
},
]
}
}
})
// } else {
// this.showChildren = true
// }
}
// 家族史动态规则
// if (
// (prop == "is_first_degree" || prop == "is_other_sickness") &&
// Boolean(display)
// ) {
// targetItem.rules = [
// {
// required: true,
// message: "请输入" + targetItem.label,
// },
// ]
// } else if (
// prop == "is_first_degree" ||
// prop == "is_other_sickness"
// ) {
// this.$nextTick(() => {
// targetItem.rules = []
// })
// }
// // 内镜报告动态上传
// if (prop == "check_type" && Boolean(display)) {
// targetItem.rules[0] = {
// required: true,
// message: "请上传内镜报告",
// }
// } else if (prop == "check_type") {
// targetItem.rules = []
// }
this.$set(targetItem, "display", Boolean(display)) this.$set(targetItem, "display", Boolean(display))
} }
......
<template> <template>
<div class="form-item-text"> <div class="form-item-text">
<template v-if="form[item.prop]"> <template v-if="String(form[item.prop])">
<span v-if="item.prepend">{{ item.prepend }}</span> <span v-if="item.prepend">{{ item.prepend }}</span>
<span> <span>
<span <span
v-if="item.prop == 'risk_rank'" v-if="item.prop == 'risk_rank'"
:style="{ :style="{
color: color:
form[item.prop] == '中危' form[item.prop] == 'medium'
? '#FF9F33' ? '#FF9F33'
: form[item.prop] == '低危' : form[item.prop] == 'low'
? 'green' ? 'green'
: form[item.prop] == 'high'
? 'red'
: '', : '',
}" }"
> >
{{ form[item.prop] }} {{ riskRank[form[item.prop]] }}
</span> </span>
<span <span
v-else-if="item.prop == 'screening_advise'" v-else-if="item.prop == 'screening_advise'"
style="color: #4e68ff" style="color: #4e68ff"
> >
{{ form[item.prop] }} {{ screeningAdvise[form[item.prop]] }}
</span> </span>
<span v-else style="margin: 0 5px">{{ <span v-else style="margin: 0 5px">{{
form[item.prop] | getItemText(item.dicData, item.type) String(form[item.prop]) | getItemText(item.dicData, item.type)
}}</span> }}</span>
</span> </span>
<span v-if="item.append && !item.toothBit" class="append">{{ <span v-if="item.append && !item.toothBit" class="append">{{
...@@ -43,7 +45,18 @@ export default { ...@@ -43,7 +45,18 @@ export default {
form: Object | Array, form: Object | Array,
}, },
data() { data() {
return {} return {
riskRank: {
low: "低危",
medium: "中危",
high: "高危",
},
screeningAdvise: {
1: "可定期随访",
2: "推荐胃镜精查",
3: "强烈推荐胃镜精查",
},
}
}, },
filters: { filters: {
getItemText(val, list, type) { getItemText(val, list, type) {
......
formJson = {
column: [],
labelPosition: "right",
labelSuffix: "",
labelWidth: 180,
gutter: 0,
menuBtn: true,
submitBtn: true,
submitText: "下一步",
emptyBtn: false,
emptyText: "清空",
nextTabBtn: true,
nextTabText: "下一页",
menuPosition: "center",
prevBtn: true,
group: [
{
label: "实验室检查",
prop: "1669789802778_28648",
arrow: true,
collapse: true,
display: true,
labelWidth: 8,
column: [
{
type: "input",
display: true,
importantField: false,
styles: {},
prop: "G_17",
label: "胃泌素17",
fieldType: "varchar",
fieldLength: "255",
tableName: "实验室检查",
tableCode: "gas_exam",
tableId: "1597466741234040833",
notFilter: false,
cType: "",
subfield: false,
autoRequired: 0,
personalRequired: 0,
required: true,
rules: [{ required: true, message: "胃泌素17必须填写" }],
},
{
type: "input",
display: true,
importantField: false,
styles: {},
prop: "PG_I",
label: "胃蛋白酶原I(PG I)",
fieldType: "varchar",
fieldLength: "255",
tableName: "实验室检查",
tableCode: "gas_exam",
tableId: "1597466741234040833",
notFilter: false,
cType: "",
subfield: false,
rules: [{ required: true, message: "胃蛋白酶原I(PG I)必须填写" }],
required: true,
},
{
type: "input",
display: true,
importantField: false,
styles: {},
prop: "PG_II",
label: "胃蛋白酶原II(PG II)",
fieldType: "varchar",
fieldLength: "255",
tableName: "实验室检查",
tableCode: "gas_exam",
tableId: "1597466741234040833",
notFilter: false,
cType: "",
subfield: false,
rules: [{ required: true, message: "胃蛋白酶原II(PG II)必须填写" }],
required: true,
},
{
type: "radio",
display: true,
importantField: false,
styles: {},
prop: "IgG",
label: "Hp抗体(IgG)检测",
fieldType: "varchar",
fieldLength: "255",
tableName: "实验室检查",
tableCode: "gas_exam",
tableId: "1597466741234040833",
notFilter: false,
cType: "",
subfield: false,
dicData: [
{
label: "阳性",
value: "2",
id: "1598150992287858689",
parentId: "",
},
{
label: "阴性",
value: "1",
id: "1598150963816923138",
parentId: "",
},
],
dynamicshSet: [],
dicType: "hp_antibody",
props: { label: "label", value: "value" },
disabled: false,
required: true,
rules: [{ required: true, message: "请选择Hp抗体(IgG)检测" }],
},
{
type: "upload",
disabled: false,
span: 24,
display: true,
styles: { fontSize: "18px", color: "#000" },
value: "标题",
prop: "1670203661414_80603",
cType: "",
subfield: false,
autoRequired: 0,
personalRequired: 0,
showFileList: true,
multiple: false,
bucketName: "pacs",
limit: 1,
importantField: false,
dicType: "",
label: "图片上传",
listType: "picture",
loadText: "上传中...",
accept: "image/*",
required: true,
rules: [{ required: true, message: "图片上传必须填写" }],
},
],
},
],
}
formJson = {
column: [],
labelPosition: "left",
labelSuffix: "",
labelWidth: 100,
gutter: 0,
menuBtn: true,
submitBtn: true,
submitText: "下一步",
emptyBtn: false,
emptyText: "清空",
nextTabBtn: true,
nextTabText: "下一页",
menuPosition: "center",
group: [
{
label: "筛查点信息",
prop: "1669195600018_27976",
arrow: true,
collapse: true,
display: true,
labelWidth: 8,
column: [
{
type: "input",
display: true,
importantField: false,
styles: {},
autoRequired: 0,
personalRequired: 0,
label: "医联体编号",
prop: "union_id",
fieldType: "varchar",
fieldLength: "127",
tableName: "入排选标准",
tableCode: "gas_exclusion_criteria",
tableId: "1595341111042252802",
notFilter: false,
cType: "",
subfield: false,
span: 24,
width: 12,
required: true,
rules: [{ required: true, message: "医联体编号必须填写" }],
xs: 24,
sm: 24,
md: 24,
},
{
type: "input",
display: true,
importantField: false,
styles: {},
prop: "screen_point_number",
label: "筛查点编号",
fieldType: "varchar",
fieldLength: "20",
tableName: "入排选标准",
tableCode: "gas_exclusion_criteria",
tableId: "1595341111042252802",
notFilter: false,
cType: "",
subfield: false,
span: 24,
width: 12,
rules: [{ required: true, message: "筛查点编号必须填写" }],
required: true,
xs: 24,
sm: 24,
md: 24,
},
],
},
{
label: "一、入选标准",
prop: "1669195610048_55035",
arrow: true,
collapse: true,
display: true,
labelWidth: 8,
column: [
{
type: "date",
display: true,
importantField: false,
styles: {},
prop: "birthday",
label: "出生日期",
fieldType: "date",
fieldLength: "",
format: "yyyy-MM-dd",
valueFormat: "yyyy-MM-dd",
dicType: "",
tableName: "患者信息",
tableCode: "gas_patient_info",
tableId: "1595347991491833857",
notFilter: false,
cType: "",
subfield: false,
autoRequired: 0,
personalRequired: 1,
span: 24,
width: 12,
required: true,
rules: [
{ required: true, message: "出生日期必须填写" },
{
validator: function checkAge(rule, value, callback) {
if (!value) {
return callback(new Error("请选择出生日期"))
}
var birthday = new Date(value.replace(/-/g))
var d = new Date()
var age =
d.getFullYear() -
birthday.getFullYear() -
(d.getMonth() < birthday.getMonth() ||
(d.getMonth() == birthday.getMonth() &&
d.getDate() < birthday.getDate())
? 1
: 0)
console.log(age)
if (age < 40 || age > 80) {
callback(new Error("年龄不符合筛查条件"))
} else {
callback()
}
},
trigger: "change",
},
],
disabled: false,
pattern: "checkAge",
xs: 24,
sm: 24,
md: 24,
},
{
type: "radio",
display: true,
importantField: false,
styles: {},
autoRequired: 0,
personalRequired: 0,
dicData: [
{
label: "",
value: "1",
id: "1595347527757000705",
parentId: "",
},
{
label: "",
value: "0",
id: "1595347502595371010",
parentId: "",
},
],
dynamicshSet: [],
dicType: "d-sf",
props: { label: "label", value: "value" },
prop: "is_know",
label: "知情同意",
fieldType: "tinyint",
fieldLength: "2",
tableName: "入排选标准",
tableCode: "gas_exclusion_criteria",
tableId: "1595341111042252802",
notFilter: false,
cType: "",
subfield: false,
span: 24,
width: 12,
required: true,
rules: [{ required: true, message: "请选择知情同意" }],
},
],
},
{
label: "二、排除标准",
prop: "1669707112356_13663",
arrow: true,
collapse: true,
display: true,
labelWidth: 8,
column: [
{
type: "radio",
display: true,
importantField: false,
styles: {},
autoRequired: 0,
personalRequired: 0,
label: "距上次胃镜检查间隔时间一年内",
prop: "is_one_year",
dicData: [
{
label: "",
value: "1",
id: "1595347527757000705",
parentId: "",
},
{
label: "",
value: "0",
id: "1595347502595371010",
parentId: "",
},
],
dynamicshSet: [],
dicType: "d-sf",
props: { label: "label", value: "value" },
fieldType: "tinyint",
fieldLength: "2",
tableName: "入排选标准",
tableCode: "gas_exclusion_criteria",
tableId: "1595341111042252802",
notFilter: false,
cType: "",
subfield: false,
span: 24,
labelWidth: 850,
width: 24,
xs: 24,
sm: 24,
md: 24,
},
{
type: "radio",
display: true,
importantField: false,
styles: {},
label: "胃大部切除术手术史",
prop: "is_subtotal_history",
fieldType: "tinyint",
fieldLength: "2",
dicData: [
{
label: "",
value: "1",
id: "1595347527757000705",
parentId: "",
},
{
label: "",
value: "0",
id: "1595347502595371010",
parentId: "",
},
],
dynamicshSet: [],
dicType: "d-sf",
props: { label: "label", value: "value" },
tableName: "入排选标准",
tableCode: "gas_exclusion_criteria",
tableId: "1595341111042252802",
notFilter: false,
cType: "",
subfield: false,
span: 24,
labelWidth: 850,
width: 24,
xs: 24,
sm: 24,
md: 24,
lg: 24,
autoRequired: 0,
personalRequired: 0,
},
{
type: "radio",
display: true,
importantField: false,
styles: {},
prop: "is_ppi",
label:
"两周内服用PPI(埃索美拉唑、泮托拉唑、雷贝拉唑、兰索拉唑等)或H2受体拮抗剂(法莫替丁等)",
dicData: [
{
label: "",
value: "1",
id: "1595347527757000705",
parentId: "",
},
{
label: "",
value: "0",
id: "1595347502595371010",
parentId: "",
},
],
dynamicshSet: [],
dicType: "d-sf",
props: { label: "label", value: "value" },
fieldType: "tinyint",
fieldLength: "2",
tableName: "入排选标准",
tableCode: "gas_exclusion_criteria",
tableId: "1595341111042252802",
notFilter: false,
cType: "",
subfield: false,
span: 24,
labelWidth: 850,
width: 24,
xs: 24,
sm: 24,
md: 24,
lg: 24,
},
{
type: "radio",
display: true,
importantField: false,
styles: {},
dicData: [
{
label: "",
value: "1",
id: "1595347527757000705",
parentId: "",
},
{
label: "",
value: "0",
id: "1595347502595371010",
parentId: "",
},
],
dynamicshSet: [],
dicType: "d-sf",
props: { label: "label", value: "value" },
prop: "is_symptom",
label:
"有下列一种或多种症状: 6个月内缺铁性贫血;12个月内消化道出血(黑便、血便等);体重减轻(非减肥原因6个月内体重减轻≥4.5Kg);经常性腹泻;吞咽困难或哽噎感;腹部肿块",
fieldType: "tinyint",
fieldLength: "2",
tableName: "入排选标准",
tableCode: "gas_exclusion_criteria",
tableId: "1595341111042252802",
notFilter: false,
cType: "",
subfield: false,
span: 24,
labelWidth: 850,
width: 24,
xs: 24,
sm: 24,
md: 24,
lg: 24,
},
{
type: "radio",
display: true,
importantField: false,
styles: {},
dicData: [
{
label: "",
value: "1",
id: "1595347527757000705",
parentId: "",
},
{
label: "",
value: "0",
id: "1595347502595371010",
parentId: "",
},
],
dynamicshSet: [],
dicType: "d-sf",
props: { label: "label", value: "value" },
prop: "is_disease",
label:
"有以下任何一种疾病史 食管癌、胃癌、结直肠肿瘤、炎症性肠病、其它器官恶性肿瘤(乳腺、卵巢、子宫及泌尿系统等)",
fieldType: "tinyint",
fieldLength: "2",
tableName: "入排选标准",
tableCode: "gas_exclusion_criteria",
tableId: "1595341111042252802",
notFilter: false,
cType: "",
subfield: false,
span: 24,
labelWidth: 850,
width: 24,
xs: 24,
sm: 24,
md: 24,
lg: 24,
},
{
type: "radio",
display: true,
importantField: false,
styles: {},
dicData: [
{
label: "",
value: "1",
id: "1595347527757000705",
parentId: "",
},
{
label: "",
value: "0",
id: "1595347502595371010",
parentId: "",
},
],
dynamicshSet: [],
dicType: "d-sf",
props: { label: "label", value: "value" },
prop: "is_tumour",
label: "影像、肿瘤标志物等检查高度怀疑罹患肿瘤可能",
fieldType: "tinyint",
fieldLength: "2",
tableName: "入排选标准",
tableCode: "gas_exclusion_criteria",
tableId: "1595341111042252802",
notFilter: false,
cType: "",
subfield: false,
span: 24,
labelWidth: 850,
width: 24,
xs: 24,
sm: 24,
md: 24,
lg: 24,
},
{
type: "radio",
display: true,
importantField: false,
styles: {},
dicData: [
{
label: "",
value: "1",
id: "1595347527757000705",
parentId: "",
},
{
label: "",
value: "0",
id: "1595347502595371010",
parentId: "",
},
],
dynamicshSet: [],
dicType: "d-sf",
props: { label: "label", value: "value" },
prop: "is_Incomplete",
label: "严重心、肺、肝、肾功能不全,或严重精神疾患",
fieldType: "tinyint",
fieldLength: "2",
tableName: "入排选标准",
tableCode: "gas_exclusion_criteria",
tableId: "1595341111042252802",
notFilter: false,
cType: "",
subfield: false,
span: 24,
labelWidth: 850,
width: 24,
xs: 24,
sm: 24,
md: 24,
lg: 24,
},
],
},
],
}
...@@ -470,7 +470,7 @@ export function excelExport(data, title = "结果") { ...@@ -470,7 +470,7 @@ export function excelExport(data, title = "结果") {
export function formatDicList(list, value, connector = ",") { export function formatDicList(list, value, connector = ",") {
if (!list) return "" if (!list) return ""
if (list.constructor !== Array) return "" if (list.constructor !== Array) return ""
if (!value && value != 0) return "" // if (!value && value != 0) return ""
let result = "" let result = ""
let multiple = Array.isArray(value) ? true : false let multiple = Array.isArray(value) ? true : false
if (multiple) { if (multiple) {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
> >
<div v-if="formTabs && formTabs.length > 0"> <div v-if="formTabs && formTabs.length > 0">
<el-button <el-button
v-if="!disabled"
class="draftButton" class="draftButton"
@click="onSubmit(formType)" @click="onSubmit(formType)"
:loading="loading" :loading="loading"
...@@ -152,11 +153,11 @@ export default { ...@@ -152,11 +153,11 @@ export default {
// 第四步风险评估 // 第四步风险评估
this.$nextTick(() => { this.$nextTick(() => {
//! //!
this.formInitial = { // this.formInitial = {
risk_rank: "中危", // risk_rank: "中危",
risk_score: "5分", // risk_score: "5分",
screening_advise: "立刻住院", // screening_advise: "立刻住院",
} // }
}) })
} else { } else {
this.formInitial = false this.formInitial = false
......
...@@ -87,7 +87,7 @@ export default { ...@@ -87,7 +87,7 @@ export default {
patientStandbyId: String, patientStandbyId: String,
getAll: Boolean, // 获取页面所有数据 getAll: Boolean, // 获取页面所有数据
survivalFlag: Boolean, //存活的显示 survivalFlag: Boolean, //存活的显示
formEdit: Object, formEdit: {},
formInitial: {}, formInitial: {},
}, },
provide() { provide() {
...@@ -105,11 +105,7 @@ export default { ...@@ -105,11 +105,7 @@ export default {
asideShow: false, asideShow: false,
widgetFormPreview: {}, widgetFormPreview: {},
formData: { formData: {
formEdit: { formEdit: {},
// risk_rank: "中危",
// risk_score: "5分",
// screening_advise: "立刻住院",
},
percent: {}, percent: {},
formRecordId: null, formRecordId: null,
}, },
...@@ -131,217 +127,7 @@ export default { ...@@ -131,217 +127,7 @@ export default {
nextTabBtn: true, nextTabBtn: true,
nextTabText: "下一页", nextTabText: "下一页",
menuPosition: "center", menuPosition: "center",
group: [ group: [],
{
label: "个人信息",
prop: "1669858228269_22763",
arrow: true,
collapse: true,
display: true,
labelWidth: 8,
column: [
{
type: "input",
display: true,
importantField: true,
styles: {},
autoRequired: 0,
personalRequired: 0,
prop: "name",
label: "姓名",
fieldType: "varchar",
fieldLength: "50",
tableName: "存活情况",
tableCode: "gas_survival_situation",
tableId: "1598137567272861697",
notFilter: false,
cType: "",
subfield: false,
},
{
type: "input",
display: true,
importantField: true,
styles: {},
autoRequired: 0,
personalRequired: 0,
prop: "contact_phone",
label: "手机号",
fieldType: "varchar",
fieldLength: "20",
tableName: "存活情况",
tableCode: "gas_survival_situation",
tableId: "1598137567272861697",
notFilter: false,
cType: "",
subfield: false,
},
{
type: "input",
display: true,
importantField: true,
styles: {},
autoRequired: 0,
personalRequired: 0,
prop: "telephone",
label: "联系电话",
fieldType: "varchar",
fieldLength: "20",
tableName: "存活情况",
tableCode: "gas_survival_situation",
tableId: "1598137567272861697",
notFilter: false,
cType: "",
subfield: false,
},
{
type: "input",
display: true,
importantField: true,
styles: {},
autoRequired: 0,
personalRequired: 0,
prop: "sex",
label: "性别",
fieldType: "tinyint",
fieldLength: "2",
tableName: "存活情况",
tableCode: "gas_survival_situation",
tableId: "1598137567272861697",
notFilter: false,
cType: "",
subfield: false,
},
{
type: "input",
display: true,
importantField: true,
styles: {},
autoRequired: 0,
personalRequired: 0,
prop: "birthday",
label: "出生日期",
fieldType: "date",
fieldLength: "",
tableName: "存活情况",
tableCode: "gas_survival_situation",
tableId: "1598137567272861697",
notFilter: false,
cType: "",
subfield: false,
},
{
type: "input",
display: true,
importantField: true,
styles: {},
autoRequired: 0,
personalRequired: 0,
prop: "age",
label: "年龄",
fieldType: "int",
fieldLength: "4",
tableName: "存活情况",
tableCode: "gas_survival_situation",
tableId: "1598137567272861697",
notFilter: false,
cType: "",
subfield: false,
},
],
},
{
label: "第一次随访计划",
prop: "1669858313508_15760",
arrow: true,
collapse: true,
display: true,
labelWidth: 8,
column: [
{
type: "radio",
display: true,
importantField: true,
styles: {},
prop: "is_continue_follow",
label: "是否随访",
dicData: [
{
label: "",
value: "1",
id: "1595347527757000705",
parentId: "",
},
{
label: "",
value: "0",
id: "1595347502595371010",
parentId: "",
},
],
dynamicshSet: [],
dicType: "d-sf",
props: {
label: "label",
value: "value",
},
fieldType: "tinyint",
fieldLength: "2",
tableName: "随访计划",
tableCode: "gas_follow",
tableId: "1597491580053323777",
notFilter: false,
cType: "",
subfield: false,
value: "1",
span: 24,
autoRequired: 0,
personalRequired: 0,
},
{
type: "date",
display: true,
importantField: true,
styles: {},
prop: "first_follow_time",
label: "随访时间",
format: "yyyy-MM-dd",
valueFormat: "yyyy-MM-dd",
dicType: "",
fieldType: "date",
tableName: "随访计划",
tableCode: "gas_follow",
tableId: "1597491580053323777",
notFilter: false,
cType: "",
subfield: false,
span: 12,
autoRequired: 0,
personalRequired: 0,
width: 12,
},
{
type: "input",
display: true,
importantField: true,
styles: {},
prop: "follow_contents",
label: "随访内容",
fieldType: "text",
tableName: "随访计划",
tableCode: "gas_follow",
tableId: "1597491580053323777",
notFilter: false,
cType: "",
subfield: false,
autoRequired: 0,
personalRequired: 0,
span: 12,
width: 12,
},
],
},
],
}, },
} }
}, },
...@@ -360,6 +146,7 @@ export default { ...@@ -360,6 +146,7 @@ export default {
}, },
methods: { methods: {
initData() { initData() {
console.log("有patientId,获取数据")
this.formData.formRecordId = null this.formData.formRecordId = null
this.formCacheList = [] this.formCacheList = []
this.getPatientDetail() this.getPatientDetail()
...@@ -479,9 +266,15 @@ export default { ...@@ -479,9 +266,15 @@ export default {
formatData(res, cache) { formatData(res, cache) {
const d = res.data || {} const d = res.data || {}
const form = d.data || {} const form = d.data || {}
for (const key in form) {
Object.prototype.toString.call(form[key]) == "[object Number]"
? (form[key] = String(form[key]))
: ""
}
if (form["YZZKJC"] && typeof form["YZZKJC"] === "string") { if (form["YZZKJC"] && typeof form["YZZKJC"] === "string") {
form["YZZKJC"] = JSON.parse(form["YZZKJC"]) form["YZZKJC"] = JSON.parse(form["YZZKJC"])
} }
console.log(form)
if (!cache) { if (!cache) {
this.formData.formEdit = form this.formData.formEdit = form
} }
......
...@@ -49,7 +49,7 @@ export default { ...@@ -49,7 +49,7 @@ export default {
components: { ConfigForms }, components: { ConfigForms },
data() { data() {
return { return {
isDetail: false, isDetail: false, //! 控制详情显隐
listLoading: false, listLoading: false,
disabled: false, disabled: false,
tableData: [], tableData: [],
...@@ -159,7 +159,12 @@ export default { ...@@ -159,7 +159,12 @@ export default {
minWidth: 120, minWidth: 120,
value: "riskRank", value: "riskRank",
formatter: (row) => { formatter: (row) => {
return row.riskRank ? row.riskRank : "--" let riskRank = {
low: "低危",
medium: "中危",
high: "高危",
}
return row.riskRank ? riskRank[row.riskRank] : "--"
}, },
}, },
{ {
...@@ -244,11 +249,11 @@ export default { ...@@ -244,11 +249,11 @@ export default {
handleView(row) { handleView(row) {
this.handleAdd(row, null, true) this.handleAdd(row, null, true)
}, },
handleAdd({ patient_id, hzxx_xm }, index, disabled = false) { handleAdd({ patientId, name }, index, disabled = false) {
this.disabled = disabled this.disabled = disabled
this.patientId = patientId || null
this.name = name
this.isDetail = true this.isDetail = true
this.patientId = patient_id || null
this.name = hzxx_xm
}, },
sortChange({ prop, order }) { sortChange({ prop, order }) {
...@@ -278,7 +283,7 @@ export default { ...@@ -278,7 +283,7 @@ export default {
} }
data.current = this.pageIndex data.current = this.pageIndex
data.size = this.pageSize data.size = this.pageSize
data.isGraft = 0 data.isDraft = 0
data.patientFrom = this.selectedIndex data.patientFrom = this.selectedIndex
getPatientPage(data).then((res) => { getPatientPage(data).then((res) => {
this.listLoading = false this.listLoading = false
......
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