Commit f03401ad authored by lrw's avatar lrw

填报查看

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