Commit f03401ad authored by lrw's avatar lrw

填报查看

parent a48c15db
This diff is collapsed.
......@@ -27,7 +27,7 @@
:style="{opacity: item.required ? 1 : 0}">*</span>{{item.label}}</view>
<picker @change="updatePickerVal($event,item)" range-key="label" mode="selector" :value="form[item.value]" :range="item.opts">
<view class="picker">
{{form[item.value]?form[item.value]:'请选择'}}
{{form[item.value]?formMat[item.value]:'请选择'}}
</view>
</picker>
</view>
......@@ -98,7 +98,7 @@
</view>
</template>
<view class="padding">
<view class="padding" v-show="!isRead">
<button form-type="submit" class="cu-btn block bg-blue margin-tb-sm lg">提 交</button>
</view>
</form>
......@@ -116,8 +116,7 @@
},
data() {
return {
id: '',
radio: [],
isRead: false,
list: [
{
......@@ -127,31 +126,31 @@
titleClass: 'title',
type: 'pickerMore',
opts: [{
value: '已经确诊',
value: 'a',
label: '已经确诊'
}, {
value: '疑似诊断',
value: 'b',
label: '疑似诊断'
}, {
value: '亲密接触者',
value: 'c',
label: '亲密接触者'
}, {
value: '居家观察/正在接受集中医学观察',
value: 'd',
label: '居家观察/正在接受集中医学观察'
}, {
value: '已解除集中医学观察',
value: 'e',
label: '已解除集中医学观察'
}, {
value: '无上述情况',
value: 'f',
label: '无上述情况'
}],
showList: [{
value: '亲密接触者',
value: 'c',
show: [32, 35, 38, 40, 43, 45, 47]
},
{
value: '居家观察/正在接受集中医学观察',
value: 'd',
show: [49, 50]
},
]
......@@ -400,34 +399,34 @@
titleClass: 'title',
type: 'pickerMore',
opts: [{
value: '发热',
value: 'a',
label: '发热'
}, {
value: '咳嗽',
value: 'b',
label: '咳嗽'
}, {
value: '流涕',
value: 'c',
label: '流涕'
}, {
value: '咽痛',
value: 'd',
label: '咽痛'
}, {
value: '咳痰',
value: 'e',
label: '咳痰'
}, {
value: '胸痛',
value: 'f',
label: '胸痛'
}, {
value: '肌肉酸痛/关节痛',
value: 'g',
label: '肌肉酸痛/关节痛'
}, {
value: '气促',
value: 'h',
label: '气促'
}, {
value: '腹泻',
value: 'i',
label: '腹泻'
}, {
value: '以上均无',
value: 'j',
label: '以上均无'
}]
},
......@@ -663,41 +662,60 @@
hidden: true,
},
],
form: {}
form: {},
formMat: {}
}
},
onLoad(option) {
// 获取信息
this.$http.post(`/sict-ncov/report`, this.form).then(res => {
console.log(res)
})
const data = {
currentStatus: '亲密接触者'
}
for (let k in data) {
const val = data[k]
if (val) {
const item = this.list.find(child => child.value == k)
if (item) {
this.showChange({
value: val
}, item)
if (item.type == "pickerMore") {
console.log(1,22)
item.opts.forEach(opt => {
val.split(',').forEach(v => {
if (v === opt.label) {
console.log(opt)
this.$set(opt, 'checked', true)
}
})
})
this.$http.get(`/sict-ncov/report/daily`).then(res => {
const d = res.data
if (d.code == 1) {
this.isRead = true
const data = d.object || {}
this.form = data
// 赋值
for (let k in data) {
const val = data[k]
if (val) {
const item = this.list.find(child => child.value == k)
if (item) {
this.showChange({
value: val
}, item)
if (item.type == "pickerMore") {
item.opts.forEach(opt => {
val.split(',').forEach(v => {
if (v === opt.value) {
this.$set(opt, 'checked', true)
}
})
})
}
if (item.type == "picker") {
item.opts.forEach(opt => {
if (opt.value == val) {
this.formMat[k] = opt.label
}
})
}
if (item.type == "pickerAddress") {
item.opts.forEach(opt => {
if (opt.value == val) {
this.formMat[k] = opt.label
}
})
}
}
}
}
}
}
})
},
......@@ -718,13 +736,13 @@
this.$set(checkList[i], 'checked', false)
}
this.$set(checkList[checkList.length - 1], 'checked', true)
this.form[prop] = obj.label
this.form[prop] = obj.value
} else {
this.$set(checkList[checkList.length - 1], 'checked', false)
const values = []
for (var i = 0, lenI = checkList.length; i < lenI; ++i) {
if (checkList[i].checked) {
values.push(checkList[i].label)
values.push(checkList[i].value)
}
}
this.form[prop] = values.join(',')
......@@ -748,10 +766,11 @@
current.show.forEach(child => {
this.list.forEach(row => {
if (child == row.num) {
this.$set(row, 'hidden', !current.showValue.includes(val))
this.$set(row, 'hidden', !current.showValue.includes(String(val)))
}
})
})
break
}
}
}
......@@ -773,7 +792,22 @@
}
}
if (type === 'picker') {
let val = evt.value || item.opts[evt.detail.value].value;
for (let i = 0; i < this.list.length; i++) {
const current = this.list[i]
if (current.value == prop && current.show) {
current.show.forEach(child => {
this.list.forEach(row => {
if (child == row.num) {
this.$set(row, 'hidden', !current.showValue.includes(val))
}
})
})
break
}
}
}
},
isShowChild() {
......@@ -796,7 +830,11 @@
this.$set(this.form, prop, val)
return
}
this.$set(this.form, prop, opts[val].label)
this.$set(this.form, prop, opts[val].value)
this.$set(this.formMat, prop, opts[val].label)
if (item.show) {
this.showChange(event, item)
}
},
// 提交信息
formSubmit() {
......
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