|
@@ -117,14 +117,16 @@
|
|
|
</window-size>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
-import {reactive, ref} from "vue";
|
|
|
+import {onMounted, reactive, ref} from "vue";
|
|
|
import {submitInpatientSatisfiedAssessment} from '../../../api/assessments'
|
|
|
-import {showDialog} from "vant";
|
|
|
+import {showDialog, showToast} from "vant";
|
|
|
import {useRouter} from "vue-router";
|
|
|
|
|
|
const router = useRouter()
|
|
|
const answer = reactive({
|
|
|
- patientId: router.currentRoute.value.params.patientId
|
|
|
+ inpatientNo: null,
|
|
|
+ times: null,
|
|
|
+ patientId: null
|
|
|
})
|
|
|
const disableSubmitButton = ref(false)
|
|
|
|
|
@@ -198,6 +200,11 @@ const checkboxOptions = [
|
|
|
]
|
|
|
|
|
|
const submitAnswer = () => {
|
|
|
+ for (let i = 0; i < keyList.length; i++) {
|
|
|
+ if (!validAnswer(i)) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
submitInpatientSatisfiedAssessment(answer).then(res => {
|
|
|
disableSubmitButton.value = true
|
|
|
showDialog({
|
|
@@ -206,11 +213,51 @@ const submitAnswer = () => {
|
|
|
}).then(() => {})
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+const keyList = [
|
|
|
+ {key1: 'item1', key2: 'item2Arr'},
|
|
|
+ {key1: 'item3', key2: 'item4Arr'},
|
|
|
+ {key1: 'item5', key2: 'item6Arr'},
|
|
|
+ {key1: 'item7', key2: 'item8Arr'},
|
|
|
+ {key1: 'item9', key2: 'item10Arr'},
|
|
|
+ {key1: 'item11', key2: 'item12Arr'},
|
|
|
+ {key1: 'item13', key2: 'item14Arr'},
|
|
|
+ {key1: 'item15', key2: 'item16Arr'},
|
|
|
+ {key1: 'item17', key2: 'item18Arr'},
|
|
|
+ {key1: 'item19', key2: 'item20Arr'},
|
|
|
+ {key1: 'item21', key2: 'item22Arr'},
|
|
|
+]
|
|
|
+const validAnswer = (index) => {
|
|
|
+ let keyObj = keyList[index]
|
|
|
+ if (answer[keyObj.key1] === 'B' && !answer[keyObj.key2]) {
|
|
|
+ showToast({
|
|
|
+ message: `请勾选【${index + 1}-2】中您不满意的原因。`,
|
|
|
+ position: 'top',
|
|
|
+ duration: 3000,
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ let visitId = router.currentRoute.value.params.visitId
|
|
|
+ let visitIdArr = visitId.split('AND')
|
|
|
+ if (visitIdArr.length < 3) {
|
|
|
+ answer.inpatientNo = 'unknown'
|
|
|
+ answer.times = 0
|
|
|
+ answer.patientId = visitId
|
|
|
+ } else {
|
|
|
+ answer.inpatientNo = visitIdArr[0]
|
|
|
+ answer.times = visitIdArr[1]
|
|
|
+ answer.patientId = visitIdArr[2]
|
|
|
+ }
|
|
|
+})
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
.question-box {
|
|
|
padding: 6px 0 12px 6px;
|
|
|
- border-bottom: 1px dashed gray;
|
|
|
+ border-bottom: 1px dashed rgb(128, 128, 128);
|
|
|
}
|
|
|
</style>
|