|
|
@ -43,8 +43,8 @@ |
|
|
<div class="reason-section"> |
|
|
<div class="reason-section"> |
|
|
<div class="section-label">请选择无法扫码的原因:</div> |
|
|
<div class="section-label">请选择无法扫码的原因:</div> |
|
|
<div class="reason-tags"> |
|
|
<div class="reason-tags"> |
|
|
<div v-for="(reason, index) in reasonOptions" :key="index" class="reason-tag" |
|
|
<div v-for="(reason, index) in filteredReasonOptions" :key="reason.value" class="reason-tag" |
|
|
:class="{ active: selectedReason === index }" @click="selectedReason = index"> |
|
|
:class="{ active: selectedReason === reason.originalIndex }" @click="selectedReason = reason.originalIndex"> |
|
|
{{ reason.text }} |
|
|
{{ reason.text }} |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
@ -91,7 +91,7 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup name="ScanEntQRCode"> |
|
|
<script setup name="ScanEntQRCode"> |
|
|
import { ref, reactive, onMounted, onBeforeUnmount, nextTick } from 'vue'; |
|
|
import { ref, reactive, computed, onMounted, onBeforeUnmount, nextTick } from 'vue'; |
|
|
import { useRouter, useRoute } from 'vue-router'; |
|
|
import { useRouter, useRoute } from 'vue-router'; |
|
|
import { showFailToast, showSuccessToast, showToast, showConfirmDialog } from 'vant'; |
|
|
import { showFailToast, showSuccessToast, showToast, showConfirmDialog } from 'vant'; |
|
|
import { baseUrl, appEnv } from '@/config/env.js'; |
|
|
import { baseUrl, appEnv } from '@/config/env.js'; |
|
|
@ -335,6 +335,12 @@ const error = ref(false); |
|
|
|
|
|
|
|
|
const reasonOptions = ref([]); |
|
|
const reasonOptions = ref([]); |
|
|
|
|
|
|
|
|
|
|
|
const filteredReasonOptions = computed(() => { |
|
|
|
|
|
return reasonOptions.value |
|
|
|
|
|
.map((item, index) => ({ ...item, originalIndex: index })) |
|
|
|
|
|
.filter(item => item.text !== '补录' && item.value !== '补录'); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
const showSearchPopup = () => { |
|
|
const showSearchPopup = () => { |
|
|
showSearchModal.value = true; |
|
|
showSearchModal.value = true; |
|
|
searchKeyword.value = ''; |
|
|
searchKeyword.value = ''; |
|
|
@ -345,16 +351,16 @@ const showSearchPopup = () => { |
|
|
if (reasonOptions.value.length === 0) { |
|
|
if (reasonOptions.value.length === 0) { |
|
|
loadDict('no-scan-reason', (columns) => { |
|
|
loadDict('no-scan-reason', (columns) => { |
|
|
reasonOptions.value = columns; |
|
|
reasonOptions.value = columns; |
|
|
const otherIndex = columns.findIndex(item => item.text === '其他' || item.value === '其他'); |
|
|
const otherItem = filteredReasonOptions.value.find(item => item.text === '其他' || item.value === '其他'); |
|
|
selectedReason.value = otherIndex !== -1 ? otherIndex : 0; |
|
|
selectedReason.value = otherItem ? otherItem.originalIndex : (filteredReasonOptions.value[0]?.originalIndex ?? 0); |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
loadEnterprises(); |
|
|
loadEnterprises(); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
if (selectedReason.value === -1) { |
|
|
if (selectedReason.value === -1) { |
|
|
const otherIndex = reasonOptions.value.findIndex(item => item.text === '其他' || item.value === '其他'); |
|
|
const otherItem = filteredReasonOptions.value.find(item => item.text === '其他' || item.value === '其他'); |
|
|
selectedReason.value = otherIndex !== -1 ? otherIndex : 0; |
|
|
selectedReason.value = otherItem ? otherItem.originalIndex : (filteredReasonOptions.value[0]?.originalIndex ?? 0); |
|
|
} |
|
|
} |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
loadEnterprises(); |
|
|
loadEnterprises(); |
|
|
@ -473,11 +479,11 @@ const toSign = () => { |
|
|
onMounted(() => { |
|
|
onMounted(() => { |
|
|
loadDict('no-scan-reason', (columns) => { |
|
|
loadDict('no-scan-reason', (columns) => { |
|
|
reasonOptions.value = columns; |
|
|
reasonOptions.value = columns; |
|
|
const otherIndex = columns.findIndex(item => item.text === '其他' || item.value === '其他'); |
|
|
const otherItem = filteredReasonOptions.value.find(item => item.text === '其他' || item.value === '其他'); |
|
|
if (otherIndex !== -1) { |
|
|
if (otherItem) { |
|
|
selectedReason.value = otherIndex; |
|
|
selectedReason.value = otherItem.originalIndex; |
|
|
} else if (columns.length > 0) { |
|
|
} else if (filteredReasonOptions.value.length > 0) { |
|
|
selectedReason.value = 0; |
|
|
selectedReason.value = filteredReasonOptions.value[0].originalIndex; |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|