Commit 32d68a00 authored by miaojiale's avatar miaojiale

自测修复bug

parent 8df3ba78
...@@ -327,7 +327,11 @@ ...@@ -327,7 +327,11 @@
@change="handleChange" @change="handleChange"
></el-date-picker> ></el-date-picker>
<span <span
v-if="item.prop == 'birthday' && activeName == 'index0'" v-if="
item.prop == 'birthday' &&
activeName == 'index0' &&
$route.path != '/followupresearch'
"
style="margin-left: 12px" style="margin-left: 12px"
>{{ age + (age ? "岁" : "") }}</span >{{ age + (age ? "岁" : "") }}</span
> >
......
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
<span v-else-if="item.prop == 'union_id'"> <span v-else-if="item.prop == 'union_id'">
{{ handleUnionName(form[item.prop]) }} {{ handleUnionName(form[item.prop]) }}
</span> </span>
<span v-else-if="item.prop == 'age'"> <!-- <span v-else-if="item.prop == 'age'">
{{ handleAge() }} {{ handleAge() }}
</span> </span> -->
<span v-else style="margin: 0 5px">{{ <span v-else style="margin: 0 5px">{{
form[item.prop] | getItemText(item.dicData, item.type) form[item.prop] | getItemText(item.dicData, item.type)
}}</span> }}</span>
......
...@@ -22,13 +22,13 @@ formJson = { ...@@ -22,13 +22,13 @@ formJson = {
labelWidth: 8, labelWidth: 8,
column: [ column: [
{ {
type: "input", type: "select",
display: true, display: true,
importantField: false, importantField: false,
styles: {}, styles: {},
autoRequired: 0, autoRequired: 0,
personalRequired: 0, personalRequired: 0,
label: "医联体编号", label: "医联体",
prop: "union_id", prop: "union_id",
fieldType: "varchar", fieldType: "varchar",
fieldLength: "127", fieldLength: "127",
...@@ -39,12 +39,18 @@ formJson = { ...@@ -39,12 +39,18 @@ formJson = {
cType: "", cType: "",
subfield: false, subfield: false,
span: 24, span: 24,
width: 12, width: 24,
required: true, required: true,
rules: [{ required: true, message: "医联体编号必须填写" }], rules: [{ required: true, message: "医联体编号必须填写" }],
xs: 24, xs: 24,
sm: 24, sm: 24,
md: 24, md: 24,
cascaderItem: [],
filterable: true,
clearable: true,
dicType: "",
props: { label: "label", value: "value" },
dicData: [],
}, },
{ {
type: "input", type: "input",
...@@ -62,8 +68,10 @@ formJson = { ...@@ -62,8 +68,10 @@ formJson = {
cType: "", cType: "",
subfield: false, subfield: false,
span: 24, span: 24,
width: 12, width: 24,
rules: [{ required: true, message: "筛查点编号必须填写" }], rules: [
{ required: true, message: "筛查点编号必须填写", trigger: "blur" },
],
required: true, required: true,
xs: 24, xs: 24,
sm: 24, sm: 24,
...@@ -79,6 +87,110 @@ formJson = { ...@@ -79,6 +87,110 @@ formJson = {
display: true, display: true,
labelWidth: 8, labelWidth: 8,
column: [ column: [
{
type: "radio",
display: true,
importantField: false,
styles: {},
autoRequired: 0,
personalRequired: 0,
prop: "sex",
dicData: [
{
label: "",
value: "2",
id: "1595351964546281474",
parentId: "",
},
{
label: "",
value: "1",
id: "1595351940139626497",
parentId: "",
},
],
dynamicshSet: [],
dicType: "d-sex",
props: { label: "label", value: "value" },
label: "性别",
fieldType: "varchar",
fieldLength: "20",
tableName: "患者信息",
tableCode: "gas_patient_info",
tableId: "1595347991491833857",
notFilter: false,
cType: "",
subfield: false,
required: true,
rules: [{ required: true, message: "请选择性别" }],
xs: 24,
sm: 24,
md: 24,
span: 24,
width: 24,
},
{
type: "date",
display: true,
importantField: false,
styles: {},
format: "yyyy-MM-dd",
valueFormat: "yyyy-MM-dd",
prop: "survey_time",
dicType: "",
label: "调查时间",
fieldType: "datetime",
tableName: "问卷调查",
tableCode: "gas_question",
tableId: "1597462007689347074",
notFilter: false,
cType: "",
subfield: false,
span: 24,
rules: [
{ required: true, message: "调查时间必须填写" },
{
validator: function checkAge(rule, value, callback) {
if (!value) {
return callback(new Error("请选择出生日期"))
}
var sex = sessionStorage.getItem("addSex")
var survey_time = sessionStorage.getItem("survey_time")
var birthday = sessionStorage.getItem("birthday")
if (!sex || !survey_time || !birthday) {
return
}
birthday = new Date(birthday.replace(/-/g, "/"))
var d = new Date(survey_time.replace(/-/g, "/"))
var age =
d.getFullYear() -
birthday.getFullYear() -
(d.getMonth() < birthday.getMonth() ||
(d.getMonth() == birthday.getMonth() &&
d.getDate() < birthday.getDate())
? 1
: 0)
console.log(sex)
if (sex == 1) {
if (age < 40 || age > 79) {
callback(new Error("年龄不符合筛查条件"))
} else {
callback()
}
} else {
if (age < 50 || age > 79) {
callback(new Error("年龄不符合筛查条件"))
} else {
callback()
}
}
},
trigger: "change",
},
],
required: true,
pattern: "checkAge",
},
{ {
type: "date", type: "date",
display: true, display: true,
...@@ -98,9 +210,9 @@ formJson = { ...@@ -98,9 +210,9 @@ formJson = {
cType: "", cType: "",
subfield: false, subfield: false,
autoRequired: 0, autoRequired: 0,
personalRequired: 1, personalRequired: 0,
span: 24, span: 24,
width: 12, width: 24,
required: true, required: true,
rules: [ rules: [
{ required: true, message: "出生日期必须填写" }, { required: true, message: "出生日期必须填写" },
...@@ -109,8 +221,14 @@ formJson = { ...@@ -109,8 +221,14 @@ formJson = {
if (!value) { if (!value) {
return callback(new Error("请选择出生日期")) return callback(new Error("请选择出生日期"))
} }
var birthday = new Date(value.replace(/-/g)) var sex = sessionStorage.getItem("addSex")
var d = new Date() var survey_time = sessionStorage.getItem("survey_time")
var birthday = sessionStorage.getItem("birthday")
if (!sex || !survey_time || !birthday) {
return
}
birthday = new Date(birthday.replace(/-/g, "/"))
var d = new Date(survey_time.replace(/-/g, "/"))
var age = var age =
d.getFullYear() - d.getFullYear() -
birthday.getFullYear() - birthday.getFullYear() -
...@@ -119,12 +237,20 @@ formJson = { ...@@ -119,12 +237,20 @@ formJson = {
d.getDate() < birthday.getDate()) d.getDate() < birthday.getDate())
? 1 ? 1
: 0) : 0)
console.log(age) console.log(sex)
if (age < 40 || age > 80) { if (sex == 1) {
if (age < 40 || age > 79) {
callback(new Error("年龄不符合筛查条件"))
} else {
callback()
}
} else {
if (age < 50 || age > 79) {
callback(new Error("年龄不符合筛查条件")) callback(new Error("年龄不符合筛查条件"))
} else { } else {
callback() callback()
} }
}
}, },
trigger: "change", trigger: "change",
}, },
...@@ -135,6 +261,22 @@ formJson = { ...@@ -135,6 +261,22 @@ formJson = {
sm: 24, sm: 24,
md: 24, md: 24,
}, },
{
type: "input",
display: false,
importantField: false,
styles: {},
prop: "age",
label: "年龄",
fieldType: "int",
fieldLength: "11",
tableName: "患者信息",
tableCode: "gas_patient_info",
tableId: "1595347991491833857",
notFilter: false,
cType: "",
subfield: false,
},
{ {
type: "radio", type: "radio",
display: true, display: true,
...@@ -170,7 +312,7 @@ formJson = { ...@@ -170,7 +312,7 @@ formJson = {
cType: "", cType: "",
subfield: false, subfield: false,
span: 24, span: 24,
width: 12, width: 24,
required: true, required: true,
rules: [{ required: true, message: "请选择知情同意" }], rules: [{ required: true, message: "请选择知情同意" }],
}, },
...@@ -224,6 +366,9 @@ formJson = { ...@@ -224,6 +366,9 @@ formJson = {
xs: 24, xs: 24,
sm: 24, sm: 24,
md: 24, md: 24,
rules: [{ required: true, message: "请选择" }],
required: true,
pattern: "请选择",
}, },
{ {
type: "radio", type: "radio",
...@@ -266,6 +411,9 @@ formJson = { ...@@ -266,6 +411,9 @@ formJson = {
lg: 24, lg: 24,
autoRequired: 0, autoRequired: 0,
personalRequired: 0, personalRequired: 0,
rules: [{ required: true, message: "请选择" }],
required: true,
pattern: "请选择",
}, },
{ {
type: "radio", type: "radio",
...@@ -307,6 +455,9 @@ formJson = { ...@@ -307,6 +455,9 @@ formJson = {
sm: 24, sm: 24,
md: 24, md: 24,
lg: 24, lg: 24,
rules: [{ required: true, message: "请选择" }],
required: true,
pattern: "请选择",
}, },
{ {
type: "radio", type: "radio",
...@@ -348,6 +499,9 @@ formJson = { ...@@ -348,6 +499,9 @@ formJson = {
sm: 24, sm: 24,
md: 24, md: 24,
lg: 24, lg: 24,
rules: [{ required: true, message: "请选择" }],
required: true,
pattern: "请选择",
}, },
{ {
type: "radio", type: "radio",
...@@ -389,6 +543,9 @@ formJson = { ...@@ -389,6 +543,9 @@ formJson = {
sm: 24, sm: 24,
md: 24, md: 24,
lg: 24, lg: 24,
rules: [{ required: true, message: "请选择" }],
required: true,
pattern: "请选择",
}, },
{ {
type: "radio", type: "radio",
...@@ -429,6 +586,9 @@ formJson = { ...@@ -429,6 +586,9 @@ formJson = {
sm: 24, sm: 24,
md: 24, md: 24,
lg: 24, lg: 24,
rules: [{ required: true, message: "请选择" }],
required: true,
pattern: "请选择",
}, },
{ {
type: "radio", type: "radio",
...@@ -469,6 +629,9 @@ formJson = { ...@@ -469,6 +629,9 @@ formJson = {
sm: 24, sm: 24,
md: 24, md: 24,
lg: 24, lg: 24,
rules: [{ required: true, message: "请选择" }],
required: true,
pattern: "请选择",
}, },
], ],
}, },
......
...@@ -209,6 +209,9 @@ export default { ...@@ -209,6 +209,9 @@ export default {
}, },
handleAdd({ patientId, name }, index, disabled = false) { handleAdd({ patientId, name }, index, disabled = false) {
sessionStorage.removeItem("index1Data") sessionStorage.removeItem("index1Data")
sessionStorage.removeItem("survey_time")
sessionStorage.removeItem("birthday")
this.$store.commit("table/setAge", "")
this.disabled = disabled this.disabled = disabled
this.patientId = patientId || null this.patientId = patientId || null
this.name = name this.name = name
......
...@@ -337,6 +337,10 @@ export default { ...@@ -337,6 +337,10 @@ export default {
this.addPatient(data, done, cb, () => { this.addPatient(data, done, cb, () => {
this.$refs.showDialog.dialogVisible = true this.$refs.showDialog.dialogVisible = true
this.loading = false this.loading = false
sessionStorage.removeItem("birthday")
sessionStorage.removeItem("addSex")
sessionStorage.removeItem("survey_time")
this.$store.commit("table/setAge", "")
}) })
}, },
onPrev(done) { onPrev(done) {
...@@ -375,6 +379,10 @@ export default { ...@@ -375,6 +379,10 @@ export default {
}, },
continueSubmit() { continueSubmit() {
sessionStorage.removeItem("index1Data") sessionStorage.removeItem("index1Data")
sessionStorage.removeItem("birthday")
sessionStorage.removeItem("addSex")
sessionStorage.removeItem("survey_time")
this.$store.commit("table/setAge", "")
this.activeName = "index0" this.activeName = "index0"
// 清空表单 // 清空表单
// for (let i = 0; i < this.$refs.formTabs.length; i++) { // for (let i = 0; i < this.$refs.formTabs.length; i++) {
......
...@@ -418,10 +418,10 @@ export default { ...@@ -418,10 +418,10 @@ export default {
formRecordId: this.formData.formRecordId, formRecordId: this.formData.formRecordId,
}) })
.then((res) => { .then((res) => {
this.formatData(res)
sessionStorage.setItem("addSex", res.data.data.sex) sessionStorage.setItem("addSex", res.data.data.sex)
sessionStorage.setItem("birthday", res.data.data.birthday) sessionStorage.setItem("birthday", res.data.data.birthday)
sessionStorage.setItem("survey_time", res.data.data.survey_time) sessionStorage.setItem("survey_time", res.data.data.survey_time)
this.formatData(res)
}) })
.finally(() => { .finally(() => {
this.loading = false this.loading = false
...@@ -440,19 +440,23 @@ export default { ...@@ -440,19 +440,23 @@ export default {
form["YZZKJC"] = JSON.parse(form["YZZKJC"]) form["YZZKJC"] = JSON.parse(form["YZZKJC"])
} }
console.log("form形成", form, this.formData) console.log("form形成", form, this.formData)
if (form.birthday) { // if (form.survey_time && sessionStorage.getItem("survey_time")) {
let birthday = new Date(form.birthday.replace(/-/g, "/")) // let survey_time = sessionStorage.getItem("survey_time")
let date = new Date() // form.survey_time = survey_time
let age = // }
date.getFullYear() - // if (form.birthday) {
birthday.getFullYear() - // let birthday = new Date(form.birthday.replace(/-/g, "/"))
(date.getMonth() < birthday.getMonth() || // let date = new Date(form.survey_time.replace(/-/g, "/"))
(date.getMonth() == birthday.getMonth() && // let age =
date.getDate() < birthday.getDate()) // date.getFullYear() -
? 1 // birthday.getFullYear() -
: 0) // (date.getMonth() < birthday.getMonth() ||
form.age = age // (date.getMonth() == birthday.getMonth() &&
} // date.getDate() < birthday.getDate())
// ? 1
// : 0)
// form.age = age
// }
if (!cache) { if (!cache) {
this.formData.formEdit = form this.formData.formEdit = form
} }
......
...@@ -317,6 +317,9 @@ export default { ...@@ -317,6 +317,9 @@ export default {
tabDisabled = true tabDisabled = true
) { ) {
sessionStorage.removeItem("index1Data") sessionStorage.removeItem("index1Data")
sessionStorage.removeItem("survey_time")
sessionStorage.removeItem("birthday")
this.$store.commit("table/setAge", "")
this.disabled = disabled this.disabled = disabled
this.tabDisabled = tabDisabled this.tabDisabled = tabDisabled
this.patientId = patientId || null this.patientId = patientId || null
...@@ -361,9 +364,11 @@ export default { ...@@ -361,9 +364,11 @@ export default {
this.handleSearch(form) this.handleSearch(form)
}, },
handleSearch(form) { handleSearch(form) {
if (this.$route.query.checkStatus) {
this.$router.push({ this.$router.push({
query: {}, query: {},
}) })
}
this.listLoading = true this.listLoading = true
const params = Object.assign(this.cacheForm, form) const params = Object.assign(this.cacheForm, form)
const data = {} const data = {}
...@@ -440,14 +445,17 @@ export default { ...@@ -440,14 +445,17 @@ export default {
// if (this.$route.path == "/screening/index") { // if (this.$route.path == "/screening/index") {
// this.tabDisabled = false // this.tabDisabled = false
// } // }
console.log(this.$route.query.patientId)
if (this.$route.query.patientId) { if (this.$route.query.patientId) {
let patientId = this.$route.query.patientId let patientId = this.$route.query.patientId
this.patientId = patientId
// this.$nextTick(() => { // this.$nextTick(() => {
this.disabled = true this.handleView({
this.tabDisabled = false patientId: patientId,
this.patientId = patientId || null name: "",
this.isDetail = true })
// }) // })
console.log("有数据啊")
} }
}, },
mounted() { mounted() {
......
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