diff --git a/src/doctor/followUp/generalFU/form/GeneralFUForm.vue b/src/doctor/followUp/generalFU/form/GeneralFUForm.vue index f1985f12f91af826fd0e453fca3a51700df93309..2fe3b7c837787eb88a1c8b92960d6938ad78cd84 100644 --- a/src/doctor/followUp/generalFU/form/GeneralFUForm.vue +++ b/src/doctor/followUp/generalFU/form/GeneralFUForm.vue @@ -48,7 +48,7 @@ </div> <div class='img-btn mt-2' @click="toUpload('imgId')"> <input type='file' id='imgId' multiple @change='choiceImg' style='display: none' - :key='new Date().getTime()' accept="image/*"> + :key='new Date().getTime()' accept="image/*,.pdf"> <div class='flex items-center justify-center'> <div> <doc-icon type='doc-upload' class='doc-up' /> @@ -88,6 +88,8 @@ </div> </div> </div> + + <div v-if='imgList.length > 6' class='warn mt-2'>最多允许上传6张!</div> </div> <div v-if='showOne && firstForm.visitSituation == 1'> @@ -97,7 +99,7 @@ </div> <div class='img-btn mt-2' @click="toUpload('imgId2')"> <input type='file' id='imgId2' multiple @change='choiceImg2' style='display: none' - :key='new Date().getTime()-10000' accept="image/*"> + :key='new Date().getTime()-10000' accept="image/*,.pdf"> <div class='flex items-center justify-center'> <div> <doc-icon type='doc-upload' class='doc-up' /> @@ -137,6 +139,7 @@ </div> </div> </div> + <div v-if='imgList2.length > 8' class='warn mt-2'>最多允许上传8张!</div> </div> <!-- 图片预览--> @@ -342,11 +345,11 @@ export default { return form.visitHealthGuideList }, toUpload(id) { - if (id === 'imgId' && this.imgList.length >= 6) { + if (id === 'imgId' && this.imgList.length > 6) { showToast('最多允许上传6张') return } - if (id === 'imgId2' && this.imgList2.length >= 8) { + if (id === 'imgId2' && this.imgList2.length > 8) { showToast('最多允许上传8张') return } @@ -422,6 +425,9 @@ export default { onSubmit() { return new Promise((resolve, reject) => { this.$refs.form.validate().then(() => { + if (this.imgList.length > 6 || this.imgList2.length > 8) { + return + } let par = { img1: this.imgList || [], img2: this.imgList2 || [], @@ -567,6 +573,10 @@ export default { border-bottom: 0px; } +.warn { + color: #ee0a24; + text-align: left; +} </style>